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 ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

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!
 
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
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic