Win a copy of Beginning Java 17 Fundamentals: Object-Oriented Programming in Java 17 this week in the Java in General forum!
  • 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 ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

jdbc connection suddenly closed

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?
Windows 2000
MySQL 4.0.12
WHAT is your favorite color? Blue, no yellow, ahhhhhhh! Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic