• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

jdbc connection suddenly closed

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following code in a Session Bean:
...
conn = utilObj.getConnection();
System.out.println( "conn obj = " + conn ) ;
System.out.println( "conn closed = " + conn.isClosed() ) ;
SomeClass someObj = new SomeClass(conn, arg2, arg3);
...
SomeClass constructor just has:
public SomeClass(Connection c, String arg2, String arg3){
System.out.println( "conn obj = " + c ) ;
System.out.println( "conn closed = " + c.isClosed() ) ;
}
Output is as follows:
conn = com.mysql.jdbc.Connection@59f92969
conn closed = false
c = com.mysql.jdbc.Connection@59f92969
conn closed = true
Why did the connection suddenly close when I passed it into a function/constructor?
Environment:
Windows 2000
IBM WSAD 5.1
MySQL 4.0.12
Thanks!
 
The first person to drink cow's milk. That started off as a dare from this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic