/**
* 單獨的java程序連接oracle數據庫
* author
* date
*/
import java
public class Test {
public static void main(String[] args){
String driver = "oracle
String url = "jdbc:oracle:thin:@
String user = "root";
String password = "
try {
Class
Connection conn = DriverManager
if(!conn
System
Statement statement = conn
String sql = "SELECT PASSWORD from USER WHERE id=
ResultSet rs = statement
while(rs
{
System
}
rs
conn
} catch(ClassNotFoundException e) {
System
e
} catch(SQLException e) {
e
} catch(Exception e) {
e
}
}
}
From:http://tw.wingwit.com/Article/program/Java/JSP/201311/20208.html