Current specdiffs for JDBC 4.2

Mark Rotteveel mark at
Wed Dec 19 00:48:49 PST 2012

On Tue, 18 Dec 2012 15:02:00 -0500, Lance Andersen - Oracle
<Lance.Andersen at> wrote:
>> (and other methods both in CallableStatement and PreparedStatement).
>> "The second parameter must be of type Object; therefore, the java.lang
>> equivalent objects should be used for built-in types."
>> I know this sentence is used already used in Java 7 Javadoc (and
>> probably older), but it is not really helpful.
> This dates back to JDBC 1.0 
> built-in types are int, long, byte, etc so the javadocs is referring to
> using Integer, Long, Byte...
> Could probably be better stated as a primitive data type

Ah, now I get how I need to read that sentence :) Isn't that comment made
unnecessary with the introduction of auto-boxing?

>> If you read this javadoc without the spec you have no idea what this
>> actually means, additional clarification would really be helpful (to
>> end-users of JDBC); especially as some of those objects aren't even in
>> java.lang (eg java.sql.Timestamp)
> Timestamp is not a built-in type

Yes, I didn't grasp its meaning; I read 'built-in types' as 'standard JDBC
types supported by the database'. And so with 'equivalent' I was thinking
of the JDBC conversion matrix listed in appendix D (?) of the spec.
>> Out of curiosity: what would be returned for these methods in
>> as they don't seem to be very useful (to be honest: I don't really see
>> the added value of the SQLType interface in its current incarnation)
>> Will getVendorTypeNumber() return the value for the same type in
>> java.sql.Types? And if so, shouldn't that be mentioned in the javadoc?
> it does say that for JDBCTypes
> 	 Returns:
> An Integer representing the data type. For JDBCTypes, the value will be
> the same value as in Types for the data type.

Missed that part, thanks.

What is the design reason to return an Integer here and not an int?
>> (and similar methods in Statement etc returning large update counts)
>> What should a driver do or return if the database cannot return values
>> larger than Integer.MAX_VALUE; should it throw
>> SQLFeatureNotSupportedException, or should it simply return the same
>> value as executeUpdate?
> This method is supported in all environments.  Today, the current
> cannot return an update count > Integer.MAX_VALUE.  Applications who
> about this should migrate to the new methods.   the update count is the
> same
> as for executeUpdate except that you can return update counts >
> Integer.MAX_VALUE +1 without overflow

For confirmation: if the database is not capable of returning update
counts larger than Integer.MAX_VALUE, then the methods returning large
update counts should still be implemented by the driver, not throw an
SQLFeatureNotSupported, and simply return the same value(s) as returned by
the 'normal' update count equivalent methods (if so, maybe an additional
note in the Javadoc would be good)

To account for this maybe DatabaseMetaData should get a method boolean
supportsLargeUpdateCounts() which should return true if the database/driver
is capable of returning an update count larger than Integer.MAX_VALUE, and
false if it is not capable (with the added requirement that the large
update count methods must be implemented anyway).


More information about the jdbc-spec-discuss mailing list