wood burning stoves 2.0*
The moose likes JDBC and the fly likes SQL Server : Exception when taking connection second time, with out closing first Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "SQL Server : Exception when taking connection second time, with out closing first" Watch "SQL Server : Exception when taking connection second time, with out closing first" New topic
Author

SQL Server : Exception when taking connection second time, with out closing first

ak singh
Greenhorn

Joined: Nov 30, 2008
Posts: 12
I installed sql server 2005 (dev)
I have a java program which takes connection from database
connection string is :
"jdbc:sqlserver://localhost:1434;databaseName=abc"

It works fine, I modified the code now it takes connection and without closing the connection it tries to take another connection (with same database every thing same)Second time it throws an exception msg saying:: "An I/O error occurred while receiving the TDS prelogin response."

I thought its because of maximum no of connections but maximum no of connection is set to 0(ulimited).

what can be the problem and how to fix this PLEASE HELP ME!!!

ak singh
Greenhorn

Joined: Nov 30, 2008
Posts: 12
Please help...
Sreeni Gundla
Greenhorn

Joined: Dec 21, 2009
Posts: 7
ak singh wrote:Please help...


what code changes you have done is there anything specific to Connection String ..?
please paste the complete error message you have.
Sreeni Gundla
Greenhorn

Joined: Dec 21, 2009
Posts: 7
Sreeni Gundla wrote:
ak singh wrote:Please help...


what code changes you have done is there anything specific to Connection String ..?
please paste the complete error message you have.


try this
http://www.windows-tech.info/15/9b35e0338be4f112.php
ak singh
Greenhorn

Joined: Nov 30, 2008
Posts: 12

Error log is ::

ak singh
Greenhorn

Joined: Nov 30, 2008
Posts: 12
I projected the problem in very simplified way.. Actually the problem was : I migrated my application, which is used by upto 500 concurrent user, from Oracle DB to Sql Server 2005. Same peace of code was working fine for Oracle database, but didnt work for Sql Server 2005.
I have fixed the problem. I commited a mistake, I was taking connection from prot 1434 (which is for browser) beacuse I was not able to take the connection from port 1433 (actually it was disabled ) when I enabled the TCS/IP protocal and changed the URL string to 1433 it started working fine.
 
 
subject: SQL Server : Exception when taking connection second time, with out closing first