How to determine if a JDBC driver is type 4?

We have an application that runs on Java 1.6 and has the ability to talk to RDBMS systems through custom plugins. We don’t care what type of database the client has, but we decided to use the type 4 driver for various reasons.

I want to programmatically decide whether the driver is type 4 so that I can immediately reject it, and not spend time debugging later, only to find out that the driver is not type 4. Since I do not know what the provider is, I cannot just see the version number. I looked at Driver.jdbcCompliant (), but this is not a prerequisite for the driver to be Type 4. I also looked at creating a connection and then thinking to see if it implements certain methods like isValid (), but again, I realized that this does not necessarily guarantee that the driver is Type 4. Any suggestions?

+3
source share
1 answer

Edit: Looks like I was still talking about something else!

DatabaseMetaData Connection.getMetaData() , getJDBCMajorVersion() >= 4. NoSuchMethodException, , JDBC 3.0+.

: , , , ... Oracle, , , 11.2 JDBC. , . Oracle!

, , , - createClob() on Connection catch NoSuchMethodException. .

0

Source: https://habr.com/ru/post/1791274/


All Articles