Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

can't connect with sql server 2000

843859Nov 13 2005 — edited Nov 20 2014
Hi,

I am facing problem connecting MS SQL Server 2000 with Java through connection pooling. Previously the same code for the web application was working fine but after some time when I try to run the same web-app through same Tomcat 5.5.7, same MS SQL Server, same JDK, same JRE, same OS, even same directory.........it simply refuses to connect............

This is the exception in tomcat:

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (Failed Logon:com.microsoft.sqlserver.jdbc.SQLServerException: TCP/IP connection failed to host:localhost java.net.ConnectException: Connection refused: connect url:jdbc:sqlserver://localhost/database=timeattendance/user=sa/password=admin123)
.
.
.
Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: Failed Logon:com.microsoft.sqlserver.jdbc.SQLServerException: TCP/IP connection failed to host:localhost java.net.ConnectException: Connection refused: connect url:jdbc:sqlserver://localhost/database=timeattendance/user=sa/password=admin123

I have checked 10 times, the password for user sa is the same as above.

Tried netstat -an it did not list port 1433.

Checked SQL server it says TCP/IP port 1433 is among its enabled protocols.

telnet localhost 1433 could not connect.

Checked firewall settings, disabled firewall, allowed port 1433.........

still !!!

simply can't connect....................

Please note that I have not made any stupid mistakes in Java code, the java code is the same that worked earlier, the only change was that previously SQL Server was on another machine on network, now it is on my own system.

Also note that SQL Enterprise Manager connects to MS SQL Server and I can see and manipulate my database through the Enterprise Manager.

Also subsituted "localhost" in connection string with my machine name and ip address respectively, none worked.

I am wondering what has went wrong, all jars libs are at their places, the issue is simply logon failure.................

Can anyone help me out with this issue ???

Thanks in advance for all your help and guidance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 25 2008
Added on Nov 13 2005
10 comments
172 views