Solved

[microsoft][sqlserver 2000 driver for jdbc]Error establishing socket

Posted on 2006-11-22
10
222 Views
Last Modified: 2010-04-01
Hi all,

My JSP application is using MS SQL 2000 as the Database.
I keep on getting this issue "[microsoft][sqlserver 2000 driver for jdbc]Error establishing socket" after running my application for a while. Is it caused by the depleted number of SQL sockets available? May I know how many available sockets are there in MS SQL 2000 before it starts to stop releasing?
Please let me know if I'm not making any sense here, thanks.
0
Comment
Question by:rospcc
  • 4
  • 2
10 Comments
 
LVL 5

Expert Comment

by:deeppra
ID: 17994686
may be all the sockets will be occupied ... so release the sockets so that other connections can be established
0
 

Author Comment

by:rospcc
ID: 17994719
deeppra, Do you know how to release those sockets?
0
 
LVL 5

Expert Comment

by:deeppra
ID: 17994754
send me the code so that i can tell u
u can close the open sockets using con.close() function where con is a Connection object
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 10

Expert Comment

by:mbvvsatish
ID: 17995055
you may not be closing or releasing the connections in your code as pointed by deeppra
you need to close the connections in the finally block
try{
......
}catch(){
....
}finally {
   if(rs!=null)
   { rs.close(); }
   if(statement!=null)
   { statement.close(); }
   if (con !=null)
   {con.close();}
}
it will be better if you use connection pool, so that you can set the max connections in the pool.
0
 
LVL 5

Expert Comment

by:deeppra
ID: 17995104
not only u have to close the connection in the finally block... after u done all the things then u have to close the connection

try {
//connect to database
//some query
//do some work
//close the connection like this
con.close();
}catch(){
....
}finally {
   if(rs!=null)
   { rs.close(); }
   if(statement!=null)
   { statement.close(); }
   if (con !=null)
   {con.close();}
}
0
 
LVL 10

Accepted Solution

by:
mbvvsatish earned 500 total points
ID: 17995217
>>not only u have to close the connection in the finally block... after u done all the things then u have to close the connection

what make you to think so. I dont think it is required. if you close/release the connection in finally block that's enough.
0
 
LVL 5

Expert Comment

by:deeppra
ID: 17995221
okay fine
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
trouble with PDF encryption using itext-1.3.1 17 88
bean mapper frameworks 5 64
Why my table column Id is not passed to java object? 4 46
going to wrong jsp page 2 46
Enabling the Skype for Business Meeting Scheduler in Hybrid OWA
Active Directory security has been a hot topic of late, and for good reason. With 90% of the world’s organization using this system to manage access to all parts of their IT infrastructure, knowing how to protect against threats and keep vulnerabil…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

756 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question