简体   繁体   中英

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

在jdbc中,如何检查,我们正在使用oracle 8i数据库?

Connection connection = DriverManager.getConnection(url);
DatabaseMetaData meta = connection.getMetaData();
String product = meta.getDatabaseProductName();
String major = meta.getDatabaseMajorVersion();
String minor = meta.getDatabaseMinorVersion();

您可能必须使用数据库元数据类

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 simple matter of parsing that 1st result row.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM