티스토리 뷰
import java.sql.*; import oracle.jdbc.driver.*; public class JDBCVersion { public static void main (String args []) throws SQLException { // Load the Oracle JDBC driver DriverManager.registerDriver (new oracle.jdbc.driver.OracleDriver()); // Change the following code line to reflect a valid connection to your Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ora10g","scott","tiger"); // Create Oracle DatabaseMetaData object DatabaseMetaData meta = conn.getMetaData (); // gets driver info: System.out.println("\n=============\nDatabase Product Name is ... " + meta.getDatabaseProductName()); System.out.println("\nDatabase Product Version is " + meta.getDatabaseProductVersion()); System.out.println("\n=============\nJDBC Driver Name is ........ " + meta.getDriverName()); System.out.println("\nJDBC Driver Version is ..... " + meta.getDriverVersion()); System.out.println("\nJDBC Driver Major Version is " + meta.getDriverMajorVersion()); System.out.println("\nJDBC Driver Minor Version is " + meta.getDriverMinorVersion()); System.out.println("\n============="); conn.close(); } }1. 컴파일 # javac -classpath .:ojdbc14.jar JDBCVersion.java 2. 수행 # java -classpath .:ojdbc14.jar JDBCVersion
'Sample Source' 카테고리의 다른 글
SAP 연동 Sample Source(.java) (1) | 2010.03.06 |
---|---|
파일 encoding 설정 값 확인하는 소스(.java, .jsp) (0) | 2010.03.06 |
Oracle 세션 허용개수 확인하는 소스(.java) (0) | 2010.03.05 |
[SampleSource] DBConnTest.java (0) | 2009.11.26 |
[SampleSource] ClassInfo.jsp (0) | 2009.11.26 |
[SampleSource] session.jsp (0) | 2009.11.26 |
[SampleSource] findClass.jsp (0) | 2009.11.26 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- Nexus
- Playbook
- 엔서블
- Password manager
- groovy
- Jenkins
- 젠킨스
- Config History
- openssl
- Thread Dump
- 파이프라인
- Ansible
- 쓰레드덤프
- iTerm2
- rsync
- Linux
- rundeck
- vagrant
- JVM
- PostgreSQL
- 데브옵스
- DevOps
- Docker
- nginx
- Shell Script
- 플레이북
- 리눅스
- 엔시블
- URL Encoding
- ssl
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
글 보관함