Java如何连接远程数据库(sql server 2000)
错误提示:java.sql.SQLException:[Microsoft][SQLServer2000DriverforJDBC]Errorestablishingso...
错误提示:java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.ecjtu.book.util.DBConnection.<clinit>(DBConnection.java:22)
如果ip地址改为127.0.0.1就有用
谢谢你们了,我已经搞好了。我把防火墙关了就好了。由于速度问题,我把分数给了第一个人。呵 展开
at com.microsoft.jdbc.base.BaseExceptions.createException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.base.BaseExceptions.getException(Unknown Source)
at com.microsoft.jdbc.sqlserver.tds.TDSConnection.<init>(Unknown Source)
at com.microsoft.jdbc.sqlserver.SQLServerImplConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.getNewImplConnection(Unknown Source)
at com.microsoft.jdbc.base.BaseConnection.open(Unknown Source)
at com.microsoft.jdbc.base.BaseDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.ecjtu.book.util.DBConnection.<clinit>(DBConnection.java:22)
如果ip地址改为127.0.0.1就有用
谢谢你们了,我已经搞好了。我把防火墙关了就好了。由于速度问题,我把分数给了第一个人。呵 展开
3个回答
展开全部
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver"亩稿陵).newInstance();
String url="jdbc:microsoft:sqlserver:/迅戚/192.168.1.109:1433;DatabaseName=metabolomics"敬清;
String user="zhanghr";
String password="000000";
Connection conn=DriverManager.getConnection(url,user,password);
String url="jdbc:microsoft:sqlserver:/迅戚/192.168.1.109:1433;DatabaseName=metabolomics"敬清;
String user="zhanghr";
String password="000000";
Connection conn=DriverManager.getConnection(url,user,password);
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
哈……看看他的数据库安装补丁了没有咯。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询