version of JDBC API

33 views
Skip to first unread message

Just Marvin

unread,
Apr 9, 2020, 1:58:05 PM4/9/20
to H2 Database
Hi,

    What version of the JDBC api does the h2 driver support? 4.1? something else?

Thanks,
Marvin

Evgenij Ryazanov

unread,
Apr 9, 2020, 11:13:30 PM4/9/20
to H2 Database
Hello.

In depends on version of H2. You should use DatabaseMetaData.getJDBCMajorVersion() and DatabaseMetaData.getJDBCMinorVersion() to detect its announced version.

For example, H2 1.4.200 returns 4.1, in the current sources of H2 the returned version is 4.2.

But this version has a very low meaning in H2 and in many other drivers. You can use some methods and features from JDBC 4.2 and 4.3 in H2 1.4.200 (such as JSR-310 data types), but some exotic methods from old versions of JDBC may not work. You should test availability of actual features and not the information from DatabaseMetaData, its methods aren't fully reliable in all or almost all JDBC drivers; H2 is not an exclusion.
Reply all
Reply to author
Forward
0 new messages