环境:
Tomcat 5.0.28
oracle 9.2.0.8.0
jdbc   ojdbc14.zip(从oracle网站下的)
怎么配置啊?在代码里这样写行吗?
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String url="jdbc:oracle:oci8:@servername";//这句行吗?
String uid="XXX";
String pwd="XXX";
Connection con = DriverManager.getConnection(url,uid,pwd);

解决方案 »

  1.   

    String url = "jdbc:oracle:thin:@MyDbComputerNameOrIP:1521:ORCL";
      

  2.   

    String url = "jdbc:oracle:thin:@localhost:1521:ORCL";
      

  3.   

    报错:The Network Adapter could not establish the connection
      

  4.   

    String url="jdbc:oracle:thin:@数据库服务器的IP:1521:SID";我的是这样啊。但还是Connection refused。
      

  5.   

    (1)确保数据库连接驱动包classes12.jar存在
    (2)url = "jdbc:oracle:thin:@10.1.16.208:1521:dev";