Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2006-11-22
10
Medium Priority
?
232 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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 2000 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

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

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

An overview of cyber security, cyber crime, and personal protection against hackers. Includes a brief summary of the Equifax breach and why everyone should be aware of it. Other subjects include: how cyber security has failed to advance with technol…
As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

636 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