求助单独用java类实现连接oracle代码
求助单独用java类实现连接oracle代码因为我要做接口程序抓数据 谢谢
java连接oracle
1.thin
Class.Forname("oracle.jdbc.driver.Oracledriver");
Connection conn=DriverManager.getConnection("jdbc:oracle:thin:@主机名:1521:例程名","用户名","密码");
2.oci8
Class.Forname("oracle.jdbc.driver.Oracledriver");
Connection conn=DriverManager.getConnection("jdbc:oracle:oci8:@网络服务","用户名","密码");
需要导包的路径:x:\oracle\ora92\jdbc\lib\classes12.jar