How to check that we are using oracle 8i database in jdbc?

In jdbc, how to verify that we are using an oracle 8i database?

+3
source share
3 answers
Connection connection = DriverManager.getConnection(url);
DatabaseMetaData meta = connection.getMetaData();
String product = meta.getDatabaseProductName();
String major = meta.getDatabaseMajorVersion();
String minor = meta.getDatabaseMinorVersion();
+6
source

You may need to use the database metadata class .

+5
source

Run:

select * from v$version

It should produce something like:

Oracle Database 10g Enterprise Edition Release 10.2.0.4.0 - 64bi
PL/SQL Release 10.2.0.4.0 - Production
...

Then it's just a matter of parsing the first line of the result.

+2
source

All Articles