We may want to document the following specifics of Derby's JDBC 4.2 implementation:
— DatabaseMetaData.getMaxLogicalLobSize() —
This is a new method added by JDBC 4.2. The javadoc for this method is terse:
Retrieves the maximum number of bytes this database allows for the logical size for a LOB.
the maximum number of bytes allowed; a result of zero means that there is no limit or the limit is not known
SQLException - if a database access error occurs"
Derby returns 0. The meaningful limits on Derby's BLOB and CLOB datatypes are documented in the datatype section of the Reference Manual.
— SQLType —
JDBC 4.2 introduces a new datatype identifier (java.sql.SQLType) to help databases describe datatypes which don't appear in the ANSI/ISO SQL Standard. The idea is that databases with non-standard types can provide their own implementations of SQLType. JDBC 4.2 also supplies its own implementation (java.sql.JDBCType) which provides an enum for each of the type ids in java.sql.Types.
Derby doesn't expose any datatypes which aren't represented by JDBCType enums and so Derby doesn't need to provide its own implementation of SQLType.
Overloads with SQLType arguments have been added to various interfaces, alongside the existing methods which take int type ids from java.sql.Types. The affected interfaces are: CallableStatement, PreparedStatement, and ResultSet. On Derby, these methods raise an "unsupported datatype" exception (SQLState 0A000) if the caller passes in a bad SQLType, namely:
1) A SQLType from a foreign database. That is a SQLType which isn't one of the JDBCType enums.
2) A JDBCType enum whose corresponding int type id (from java.sql.Types) isn't supported by Derby. The supported int type ids are documented in the datatype section of the Reference Manual. The JDBCType enums have the same names as their corresponding int ids in java.sql.Types.