Solved

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

Posted on 2006-11-22
10
229 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: 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

Technology Partners: 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!

Question has a verified solution.

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

Here's how to start interacting with our community through Post.
Article by: Justin
In light of the WannaCry ransomware attack that affected millions of Windows machines, you might wonder if your Mac needs protecting. Yes, it does and here is how to do it.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 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