java.sql.SQLException: Listener refused the connection with the following error: ORA-12505, TNS:
服务里面的OracleServiceORCL和OracleOraDb11g_home1TNSListener都打开了,LISTENER.ORA下面的(HOST=zhang...
服务里面的OracleServiceORCL和OracleOraDb11g_home1TNSListener都打开了,LISTENER.ORA下面的(HOST=zhangyang)也改成计算机名了,没用localhost,还是报异常,求教!!
Class.forName("oracle.jdbc.driver.OracleDriver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
conn=DriverManager.getConnection("jdbc:oracle:thin:@zhangyang:1521:Admin","zhangpeng","zhangpeng");
System.out.println("数据库连接成功3");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
conn.close();
System.out.println("数据库关闭成功3");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace(); 展开
Class.forName("oracle.jdbc.driver.OracleDriver");
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
conn=DriverManager.getConnection("jdbc:oracle:thin:@zhangyang:1521:Admin","zhangpeng","zhangpeng");
System.out.println("数据库连接成功3");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
conn.close();
System.out.println("数据库关闭成功3");
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace(); 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询