ocijdbc文件存在于指定的路径
中C:\应用\ debpratim1 \产品\ 11.2.0 \ dbhome_1 \ BIN \ ocijdbc11.dll
但是我遇到了运行时错误
线程中的异常" main" java.lang.UnsatisfiedLinkError:没有 java.library.path中的ocijdbc11
import java.sql.*;
import java.util.*;
class b1
{
public static void main(String args[]) throws Exception
{
System.setProperty("java.library.path",
"C:/app/debpratim1/product/11.2.0/dbhome_1/BIN/ocijdbc11.dll");
Properties p1 = new Properties();
p1.setProperty("user","scott");
p1.setProperty("password","tiger");
oracle.jdbc.driver.OracleDriver ob = new oracle.jdbc.driver.OracleDriver();
Connection con1 = ob.connect("jdbc:oracle:thin:@localhost:1521:orcl",p1);//this is working
Connection con2 = ob.connect("jdbc:oracle:oci:@localhost:1521:orcl",p1);//this is not working
System.out.println(con1);
System.out.println(con2);
con1.close();
con2.close();
}
}