sqlserver数据库连接不上[Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.
packagesqlbean;importjava.sql.Connection;importjava.sql.DriverManager;importjava.sql....
package sqlbean;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
public class SQL_Bean{
private String url = "jdbc:sqlserver://localhost:1433;;DatabaseName=db_shop";
private Connection connection = null;
public SQL_Bean() throws Exception {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
}
public Connection getConnection() throws SQLException {
setConnection();
return connection;
}
public void setConnection() throws SQLException {
this.connection = DriverManager.getConnection(url, "sa", "8888");
}
} 展开
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.sql.Statement;
public class SQL_Bean{
private String url = "jdbc:sqlserver://localhost:1433;;DatabaseName=db_shop";
private Connection connection = null;
public SQL_Bean() throws Exception {
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");
}
public Connection getConnection() throws SQLException {
setConnection();
return connection;
}
public void setConnection() throws SQLException {
this.connection = DriverManager.getConnection(url, "sa", "8888");
}
} 展开
2013-11-24
展开全部
数据库你开启子tcp/ip的访问方式了没啊?
网易云信
2023-12-06 广告
2023-12-06 广告
UIkit是一套轻量级、模块化且易于使用的开源UI组件库,由YOOtheme团队开发。它提供了丰富的界面元素,包括按钮、表单、表格、对话框、滑块、下拉菜单、选项卡等等,适用于各种类型的网站和应用程序。UIkit还支持响应式设计,可以根据不同...
点击进入详情页
本回答由网易云信提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询