Hi,
I have a question about the code below, where I check the length of the buffer variable.
In this first case, I get an error (java.lang.NullPointerException),
while in the second example the source code is interpreted correctly.
So the question arises why I can use the "buffer.Length" instruction
only only when the field (Blob) is filled with a non-Null value?
I have a question about the code below, where I check the length of the buffer variable.
In this first case, I get an error (java.lang.NullPointerException),
while in the second example the source code is interpreted correctly.
So the question arises why I can use the "buffer.Length" instruction
only only when the field (Blob) is filled with a non-Null value?
Example 1:
Dim buffer() As Byte = rs.GetBlob(ColumnName)
...
Try
If buffer.Length > 0 Then ----------- statement causing the error
...
End If
Catch
Log(LastException.Message) 'java.lang.NullPointerException
End Try
Example 2:
Dim comparison As Boolean = (rs.GetBlob(ColumnName) = Null)
If comparison Then 'Blob is Null!