File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases and the fly likes TCP/IP connection to the host port 1433 has fail Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark " TCP/IP connection to the host port 1433 has fail" Watch " TCP/IP connection to the host port 1433 has fail" New topic
Author TCP/IP connection to the host port 1433 has fail

Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
I dont know this is the right forum to put this problem.
I have been facing this problem since long time whenever I try to connect to sql server from java but managed somehow to solve this many times.
But I dont know the exact reason behind this.I am not getting solution this time.
If somebody can help me on this then his/her help will be highly appreciated.
I have enabled TCP/IP of configuration manager.
The exact stack trace is as follows, The TCP/IP connection to the host LTIB322/SQLEXPRESS, port 1433 has failed. Error: "null. 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.".
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at com.jpmc.common.dao.SqlDAOFactory.createConnection(
at com.jpmc.user.dao.UserDAO.fetchProject(
at com.jpmc.schedular.SchedularPreRequisite.getProjectListWithReports(
at com.jpmc.schedular.ReportsGenWithCronSchedular.init(
at javax.servlet.GenericServlet.init(
at org.apache.catalina.core.StandardWrapper.loadServlet(
at org.apache.catalina.core.StandardWrapper.load(
at org.apache.catalina.core.StandardContext.loadOnStartup(
at org.apache.catalina.core.StandardContext.start(
at org.apache.catalina.core.ContainerBase.addChildInternal(
at org.apache.catalina.core.ContainerBase.addChild(
at org.apache.catalina.core.StandardHost.addChild(
at org.apache.catalina.startup.HostConfig.deployWAR(
at org.apache.catalina.startup.HostConfig.deployApps(
at org.apache.catalina.startup.HostConfig.check(
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
at org.apache.catalina.manager.ManagerServlet.check(
at org.apache.catalina.manager.HTMLManagerServlet.doPost(
at javax.servlet.http.HttpServlet.service(
at javax.servlet.http.HttpServlet.service(
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(
at org.apache.catalina.core.ApplicationFilterChain.doFilter(
at org.apache.catalina.core.StandardWrapperValve.invoke(
at org.apache.catalina.core.StandardContextValve.invoke(
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(
at org.apache.catalina.core.StandardHostValve.invoke(
at org.apache.catalina.valves.ErrorReportValve.invoke(
at org.apache.catalina.core.StandardEngineValve.invoke(
at org.apache.catalina.connector.CoyoteAdapter.service(
at org.apache.coyote.http11.Http11AprProcessor.process(
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(
at Source)
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

The error message asks you to confirm that the host LTIB322/SQLEXPRESS is running SQL Server listening on port 1433. Have you indeed confirmed this? You might need to ask an administrator, or you could at least check using "telnet" to see if you can connect to that port.

[Jess in Action][AskingGoodQuestions]
Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
Thanks for reply.
SQl server instance is working on host.I can connect it through management studio.
I think this is problem with some setting of sql server.
Please suggest some solution related that.
Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
Please somebody reply.
Its urgent!!

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Is that server configured to accept connections over TCP/IP? By default SQL Server 2005 up is not.

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Tusshar Fasate
Ranch Hand

Joined: May 21, 2008
Posts: 81
I got the solution on this.
URL should be like this

I was doing like
jdbc:sqlserver://LTIB322\SQLEXPRESS;Database=RGT_DEV1 or


Now its working.
But I couldnt understand why it was giving error related to TCP/IP.
It should be somewhat like unknown host some thing.
Ok....I am happy as my problem got solved.

Thanks folk for replying to my thread.
Jan Cumps

Joined: Dec 20, 2006
Posts: 2565

Thank you for posting your solution.

OCUP UML fundamental and ITIL foundation
I agree. Here's the link:
subject: TCP/IP connection to the host port 1433 has fail
It's not a secret anymore!