jdbc连接错误 SQLException: The Network Adapter could not establish the connection
来源:互联网 发布:阿里云 视频服务 编辑:程序博客网 时间:2024/06/05 04:24
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
public class JdbcTest {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@192.0.0.1:1521:ORCL","student","123");
System.out.println(conn);
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
--------------------------------------------------------------------------------------------------------------------------------------------------------
java.sql.SQLException: The Network Adapter could not establish the connection
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:412)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:531)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:221)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:503)
at java.sql.DriverManager.getConnection(DriverManager.java:582)
at java.sql.DriverManager.getConnection(DriverManager.java:185)
at com.buaa.jdbc.JdbcTest.main(JdbcTest.java:16)
Caused by: oracle.net.ns.NetException: The Network Adapter could not establish the connection
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:359)
at oracle.net.resolver.AddrResolution.resolveAndExecute(AddrResolution.java:422)
at oracle.net.ns.NSProtocol.establishConnection(NSProtocol.java:672)
at oracle.net.ns.NSProtocol.connect(NSProtocol.java:237)
at oracle.jdbc.driver.T4CConnection.connect(T4CConnection.java:1042)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:301)
... 7 more
Caused by: java.net.ConnectException: Connection timed out: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
at java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
at java.net.Socket.connect(Socket.java:519)
at oracle.net.nt.TcpNTAdapter.connect(TcpNTAdapter.java:141)
at oracle.net.nt.ConnOption.connect(ConnOption.java:123)
at oracle.net.nt.ConnStrategy.execute(ConnStrategy.java:337)
... 12 more
错误原因:@192.0.0.1错误
解决方案:改成@127.0.0.1
- jdbc连接错误 SQLException: The Network Adapter could not establish the connection
- 数据库连接错误The Network Adapter could not establish the connection
- 错误The Network Adapter could not establish the connection
- 数据库连接错误The Network Adapter could not establish the connection
- 数据库连接错误The Network Adapter could not establish the connection
- IO 错误: The Network Adapter could not establish the connection
- 连接数据库错误The Network Adapter could not establish the connection
- The Network Adapter could not establish the connection;The Network Adapter could not establish the c
- java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection解决方案
- 关于java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection
- java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection
- java.sql.SQLException: The Network Adapter could not establish the connection
- java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection
- (java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection)
- java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection可能问题之一
- Caused by: java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection
- java.sql.SQLException: Io 异常: The Network Adapter could not establish the connection
- java.sql.SQLException: The Network Adapter could not establish the connection
- jQuery .tmpl() 用法示例介绍
- Xcode快捷键大全
- ubuntu经常掉线
- python的yield作用解析
- Linux批处理文件中的换行符问题
- jdbc连接错误 SQLException: The Network Adapter could not establish the connection
- ThinkPHP十三禁止翻墙访问
- Facebook SDK集成之登录篇
- JAXB中各种常见注解小结
- Node.js开发者必须了解的4个JS要点
- ScrollView嵌套ListView,GridView,ViewPager,以及这些控件自动滚动到底部问题的解决
- LinuxVFS文件系统缓存
- dd命令详解
- NAT穿透