제2 외국어 영역2007. 12. 6. 23:35

펌:http://blog.naver.com/levin01?Redirect=Log&logNo=100020144838

DatabaseMetaData의 getDriverVersion() 을 이용하여 알아볼 수 있다.


Connection connection = getConnection();

..

DatabaseMetaData meta = connection.getMetaData();

System.out.println("JDBC version : " + meta.getDriverVersion());

System.out.println("JDBC name : " + meta.getDriverName());

System.out.println("JDBC Major : " + meta.getDriverMajorVersion());

System.out.println("JDBC Minor : " + meta.getDriverMinorVersion());


System.out.println("Database Name : " + meta.getDatabaseProductName());

System.out.println("Database Version : " + meta.getDatabaseProductVersion());

..


결과

JDBC version : 8.1.7.0.0
JDBC name : Oracle JDBC driver
JDBC Major : 8
JDBC Minor : 1
Database Name : Oracle
Database Version : Oracle8i Enterprise Edition Release 8.1.7.0.0 - Production
With the Partitioning option
JServer Release 8.1.7.0.0 - Production

Posted by is윤군

댓글을 달아 주세요