Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

JDBC with SQL Server 2000

Status
Not open for further replies.
Dec 17, 2001
80
US
I am having trouble connecting to a Microsoft SQL Server 2000 database from my java application. The following is the error that I am receiving:

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(DriverManager.java:512)
at java.sql.DriverManager.getConnection(DriverManager.java:171)
at test.main(test.java:40)

The following is the connection URL that I am using:
jdbc:microsoft:sqlserver://172.16.105.54:1433;databaseName=testdb;

The SQL server port is set to 1433 and TCP/IP is configured under SQL. Any ideas?? Thanks.
 
Are you the only user (meaning how many active connection are there before this error is produced)...If the answer is no...then trying using connection pooling.

Also try the below
)launch the sql server network utility for sql server 2000.

2)check the properties of the enabled tcp/ip protocol. Check the default
port. If the port is different from the one specified in your database
url you get this error. match the port numbers

Also try to telnet into the SQL BOX to see if the SQL BOX is up...(try re-start MSSQLSERVER service)..
 
I didn't even think to try to telnet into the sql server port. I tried it and got a could not connect error. I restarting the MSSQL service and was able to access the database. Thanks for the advice.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top