db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Segel <mse...@segel.com>
Subject Re: No current connection
Date Fri, 03 Mar 2006 13:31:18 GMT
On Friday 03 March 2006 3:17 am, Rhys Campbell wrote:
> Hi Rajesh,
> I can post some code later when I return from work. My app is written
> using Java and uses a single table Derby database. At present this only
> has three records in it. I did try to completely shutdown Derby at the
> end of one class before restarting it in the class that had the problem.
> This had no effect on the "No current connection" issue. I am using the
> same supporting classes and so the code to access the database is also
> the same.

Just shooting from the hip....
(Or rather an under educated guess...)

Where are you defining your Connection class variable? 
I mean this sounds like a scope issue.

If you're saying:
    Connection con = Connection(....);
}   catch( SQLException ex){

Your problem is in the scope of the variable.

If this is the case, then try:
Connection con = null; 
    con =  new Connection(...);
} catch (...){

Or you can make the scope of your Connection variable at the class level.


View raw message