Tuesday, 18 September 2007

OracleDatabaseMetaData.getLobPrecision Returns Precision Of -1

When using the following code with the JDBC driver it always results in -1 for the lob precision.


System.out.println( "LOB Precision: " +


LOB Precision: -1

The same code would give the lob precision correctly when using the JDBC driver. This is an undocumented property which caused OracleDatabaseMetaData.getLobPrecision to return the string "-1". The JDBC driver now returns lob precision as -1 since, the precision value cannot fit into an int return value of the method.

To overcome this issue you can now use code as follows with the JDBC Driver.

System.out.println( "LOB Precision: " +

No comments: