Link to home
Start Free TrialLog in
Avatar of jmf8883

asked on

Connection refused error

I am getting an error message when a program I wrote tries to access an oracle database.  I wrote the program in java using jdbc.  Every morning at 3am the program access the database to update the information.  Since the server times out the connection for inactivity by then I use this line of code to refresh the connection.

connection = DriverManager.getConnection(url, username, password);
statement = connection.createStatement();

The error message I get is:
java.sql.SQlException: Listener refused the connection with the following exception:
ORA-12518, TNS: listener could not hand off client connection
The Connection descriptor used by the client was:

Java.sql.SQlException: Closed Connection
Java.sql.SQlException: Must be logged on to server

Can someone help me out with this?
Avatar of rbrooker
Flag of New Zealand image

Avatar of jmf8883


Those articles don't really have a solution.  Is this an issue I need to address with my DBA or can I write some code to get around that?
this is definately a dba issue...
Avatar of paquicuba
Flag of United States of America image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Make sure that you actually close all the ResultSets, Statements and Connections in your app after you finish the task and before you start waiting for the 24 hours.
It could be that your Oracle server isn't properly closing those connections when they time out. After you implement these changes, I'd suggest that you restart your oracle server as well.
It's a bit of a stretch, but we had something similar in MS SQL Server which was caused by statements we didn't close, so worth a try.
how to increse the number of sessions or dispatchers??? is there any command?