当前位置: 代码迷 >> Java Web开发 >> 数据库抛错
  详细解决方案

数据库抛错

热度:111   发布时间:2007-07-20 23:30:51.0
数据库抛错

程序代码:

private static String url = \"jdbc:oracle:thin:@localhost:1521:system\";

private static String user = \"system\";

private static String pw = \"19821227\";

private static Connection con = null;

public static Connection getConnection() {
if(con==null){
try {
Class.forName(\"oracle.jdbc.driver.OracleDriver\");
con = DriverManager.getConnection(url, user, pw);
} catch (ClassNotFoundException e) {
e.printStackTrace();
} catch (SQLException e) {
e.printStackTrace();
}
}
return con;
}


java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection

这是为什么啊?

搜索更多相关主题的帖子: 数据库  

----------------解决方案--------------------------------------------------------
我的数据库是10G 难道url写的有问题?
----------------解决方案--------------------------------------------------------
你建的数据库名字叫system吗?如果不是就是你url写错了
----------------解决方案--------------------------------------------------------
  相关解决方案