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
Solved

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

Posted on 2006-11-22
10
221 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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
Problem with Pie chart in Jsp 20 222
Can I clean log of  running tomcat 7 server ? 3 127
SimpleDateFormat.parse examples 19 98
web application structure 18 100
The business world is becoming increasingly integrated with tech. It’s not just for a select few anymore — but what about if you have a small business? It may be easier than you think to integrate technology into your small business, and it’s likely…
The advancement in technology has been a great source of betterment and empowerment for the human race, Nevertheless, this is not to say that technology doesn’t have any problems. We are bombarded with constant distractions, whether as an overload o…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

856 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