wood burning stoves*
The moose likes JDBC and the fly likes SQL Server 2000 connectivity error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL Server 2000 connectivity error" Watch "SQL Server 2000 connectivity error" New topic
Author

SQL Server 2000 connectivity error

BabuRajendraPrasad Tavva
Greenhorn

Joined: Jun 30, 2009
Posts: 6
Hi
I am using SQL Server2005 for my web application development. I am using the driver "com.microsoft.jdbc.sqlserver.SQLServerDriver" to connect the database. I am able to connect the database and also tested it on dev environment.
I need to deploy this on a test machine where the database is SQL Server2000. When I deploy this application on that test machine i am getting the connectivity error. When I change the driver to "com.microsoft.sqlserver.jdbc.SQLServerDriver" for test machine, still i am getting errors. The errors are as follows.
com.microsoft.sqlserver.jdbc.SQLServerException: The TCP/IP connection to the ho
st localhost, port 1433 has failed. Error: "connect timed out. Verify the connec
tion 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.".
at com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(S
QLServerException.java:170)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connectHelper(SQLSer
verConnection.java:1049)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.login(SQLServerConne
ction.java:833)
at com.microsoft.sqlserver.jdbc.SQLServerConnection.connect(SQLServerCon
nection.java:716)
at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.
java:841)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.logica.catalogueTool.db.CatalogueDAOImpl.getConnection(Unknown So
urce)
at com.logica.catalogueTool.db.CatalogueDAOImpl.getSuppliers(Unknown Sou
rce)
at org.apache.jsp.menu_jsp._jspService(menu_jsp.java:103)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper
.java:374)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:3
42)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
icationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
ilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
alve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
alve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
ava:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
ava:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
ve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
a:286)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
:845)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
ss(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
7)
at java.lang.Thread.run(Unknown Source)

What could be the reason for this error? Could you please help me out to trace out this?
Thanks in advance.
Best Regards
Babu
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Have you tried checking all the things the error message tells you? e.g. :
  • 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.


  • JavaRanch FAQ HowToAskQuestionsOnJavaRanch
    BabuRajendraPrasad Tavva
    Greenhorn

    Joined: Jun 30, 2009
    Posts: 6
    Hi Paul,
    Thanks for your reply.
    I have checked the connection properties. There is another application which uses the SQL server database and hence the database instance is always running on the host machine. The port is also enabled.
    Only the thing I have to check is the firewall block. I am checking for that.
    Do you mean to say that all the mentioned four points are ok will not result this error?
    Regards
    Babu
    Paul Sturrock
    Bartender

    Joined: Apr 14, 2004
    Posts: 10336

    There is a good chance that it should be OK.
    BabuRajendraPrasad Tavva
    Greenhorn

    Joined: Jun 30, 2009
    Posts: 6
    Hi Paul,

    I have tested the firewall thing. The port is enabled and i am able to connect to the database.
    Thanks a lot for your response and help.

    Best regards,
    Babu
     
    GeeCON Prague 2014
     
    subject: SQL Server 2000 connectivity error