250x250
Notice
Recent Posts
Recent Comments
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
Tags
- SpringBoot
- STS
- JDBC
- spring
- git
- Tomcat
- oracle
- Eclipse
- Spring Boot
- ubuntu
- Docker
- Core Java
- 문서
- 오픈소스
- IntelliJ
- jpa
- Exception
- Source
- AJAX
- MSSQL
- Open Source
- 설정
- error
- MySQL
- maven
- Python
- JavaScript
- PostgreSQL
- myBatis
- Thymeleaf
Archives
- Today
- Total
헤르메스 LIFE
[Source] A test of the Thin driver for an application 본문
728x90
import java.sql.*;
class TestThinApp {
public static void main (String args[])
throws ClassNotFoundException, SQLException {
Class.forName("oracle.jdbc.driver.OracleDriver");
// or you can use:
// DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@dssnt01:1521:dssora01","scott","tiger");
Statement stmt = conn.createStatement();
ResultSet rset = stmt.executeQuery(
"select 'Hello Thin driver tester '||USER||'!' result from dual");
while(rset.next()) System.out.println(rset.getString(1));
rset.close( );
stmt.close( );
conn.close( );
}
}
728x90
'Core Java' 카테고리의 다른 글
| [Source] Common Java Cookbook (0) | 2012.06.20 |
|---|---|
| [Source] EncodingFilter.java (0) | 2012.05.15 |
| 에러, 버그, 예외 (Error, Bug, Exception) (0) | 2011.05.03 |
| Underscore 와 field 네이밍 컨벤션 (0) | 2011.05.03 |
| [암호화] 여러 웹 프로그래밍 언어에서 서로 호환되는 문자열 암호화 클래스 (2) | 2011.01.25 |