If you're after information regarding what features any particular database supports, you could use the java.sql.DatabaseMetaData class which is obtained from the JBDC Driver.
The Sun JDK doesn't exhibit a 'JDBC Version'. The classes provided in the Sun API are merely interfaces. It's the JDBC Drivers, obtained separately and specific to each kind of database, which exhibit 'versionness', and as far as I'm aware the way to decide if any given JDBC driver will do what you want is to use the class I've already pointed out.
If the JDBC driver jar provides an implementation of javax.sql.DataSource then it supports both the old (via DriverManager) and new way (DataSource implementation registered via a JNDI provider) of creating connections.
... however, if you mean 'what version of JDBC can my JDK support', then I know that Java 1.3 supports JDBC2 drivers (I'm not sure if any previous to this do). Java 1.4 introducted support for JDBC3 drivers. You need to check the specific JDBC driver documentation to see what level of JDBC it provides.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.