sniper_I
یک شنبه 29 مرداد 1391, 10:26 صبح
دوستان سلام...
من یه مشکل کوچک برای ارتباط با بانک sql دارم. اول اینکه بانکم روی یه کامپیوتر دیگه است با ip:177.177.7.7 براش user و pass هم تعریف کردم فقط موقع اتصال این پیغام رو میده:com.microsoft.sqlserver.jdbc.SQLServerExc eption: The TCP/IP connection to the host 177.177.7.7, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and
accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".
البته نمی دونم سوالم رو جای درستی پرسیدم یا نه ولی ممنون میشم جواب بدین
اینم قطعه کد اتصالمه :
private String sqlClassForNameString="com.microsoft.sqlserver.jdbc.SQLServerDriver";
String con1="jdbc:sqlserver://177.177.7.7:1433;databaseName=Book_reservation;";
public SqlConnector(String extUrl) throws SQLException, ClassNotFoundException {
url=extUrl;
Class.forName(sqlClassForNameString);
String url = sqlConnectionURLString;
url +=this.url;
url=con1;
myUrl=url;
con = DriverManager.getConnection(myUrl, "newsqluser", "123456");
statement = con.createStatement();
}
من یه مشکل کوچک برای ارتباط با بانک sql دارم. اول اینکه بانکم روی یه کامپیوتر دیگه است با ip:177.177.7.7 براش user و pass هم تعریف کردم فقط موقع اتصال این پیغام رو میده:com.microsoft.sqlserver.jdbc.SQLServerExc eption: The TCP/IP connection to the host 177.177.7.7, port 1433 has failed. Error: "Connection refused: connect. Verify the connection properties, check that an instance of SQL Server is running on the host and
accepting TCP/IP connections at the port, and that no firewall is blocking TCP connections to the port.".
البته نمی دونم سوالم رو جای درستی پرسیدم یا نه ولی ممنون میشم جواب بدین
اینم قطعه کد اتصالمه :
private String sqlClassForNameString="com.microsoft.sqlserver.jdbc.SQLServerDriver";
String con1="jdbc:sqlserver://177.177.7.7:1433;databaseName=Book_reservation;";
public SqlConnector(String extUrl) throws SQLException, ClassNotFoundException {
url=extUrl;
Class.forName(sqlClassForNameString);
String url = sqlConnectionURLString;
url +=this.url;
url=con1;
myUrl=url;
con = DriverManager.getConnection(myUrl, "newsqluser", "123456");
statement = con.createStatement();
}