Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

JDBC Connection error to SQLSERVER 2005

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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: java.net.SocketTimeoutException: Receive timed out.)
at org.apache.commons.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1225)
at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:880)
at org.fourfive.lowservice.SimpleResourceManager.getConnection(SimpleResourceManager.java:536)


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://127.0.0.1\MSSMLBIZ,1433;DatabaseName=DW;SelectMethod=cursor" maxIdle="2" validationQuery="select 1+2 " driverClassName="com.microsoft.sqlserver.jdbc.SQLServerDriver" 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 ]
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

jdbc:sqlserver://127.0.0.1\MSSMLBIZ,1433



Are you sure this database URL is correct?
 
Revathy Raj
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tried with url="jdbc:sqlserver://REVATHY-PC\MSSMLBIZ,1433;DatabaseName=DW; SelectMethod=cursor" But the same issue comes. Any help??
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is how to build the connect URL: http://msdn.microsoft.com/en-us/library/ms378428.aspx

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

A correct URL should look like:

 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic