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 JDBC Connection error to SQLSERVER 2005 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 "JDBC Connection error to SQLSERVER 2005" Watch "JDBC Connection error to SQLSERVER 2005" New topic

JDBC Connection error to SQLSERVER 2005

Revathy Raj

Joined: Aug 16, 2008
Posts: 2
When I trying to start Tomcat I am getting the below error in stdout.log of tomcat. Can please someone help on this.

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (The connection to the named instance has failed. Error: Receive timed out.)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(
at org.apache.commons.dbcp.BasicDataSource.getConnection(
at org.fourfive.lowservice.SimpleResourceManager.getConnection(

my operating system is vista and sql server is running as named instance

The connection string that i am using in server.xml is

<Resource type="javax.sql.DataSource" auth="Container" name="jdbc/sample" url="jdbc:sqlserver://\MSSMLBIZ,1433;DatabaseName=DW;SelectMethod=cursor" maxIdle="2" validationQuery="select 1+2 " driverClassName="" maxActive="10" maxWait="500" autoCommit="true" username="newarcuser" password="newarcuser" factory="org.apache.commons.dbcp.BasicDataSourceFactory" removeAbandoned="true"></Resource>
[ August 16, 2008: Message edited by: Revathy Raj ]

Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441


Are you sure this database URL is correct?

[My Blog] [JavaRanch Journal]
Revathy Raj

Joined: Aug 16, 2008
Posts: 2
Tried with url="jdbc:sqlserver://REVATHY-PC\MSSMLBIZ,1433;DatabaseName=DW; SelectMethod=cursor" But the same issue comes. Any help??
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Here is how to build the connect URL:

The 'instanceName' and 'portNumber' are not correct writen in your URL.

A correct URL should look like:

Regards, Rene Larsen
Dropbox Invite
I agree. Here's the link:
subject: JDBC Connection error to SQLSERVER 2005
It's not a secret anymore!