1 16 19 package org.apache.xalan.lib.sql; 20 21 import java.sql.Connection ; 22 import java.sql.SQLException ; 23 24 26 public class PooledConnection 27 { 28 29 32 private Connection connection = null; 33 36 private boolean inuse = false; 37 38 43 public PooledConnection( Connection value ) 44 { 45 if ( value != null ) { connection = value; } 46 } 47 48 52 public Connection getConnection( ) 53 { 54 return connection; 56 } 57 58 64 public void setInUse( boolean value ) 65 { 66 inuse = value; 67 } 68 69 73 public boolean inUse( ) { return inuse; } 74 75 79 public void close( ) 80 { 81 try 82 { 83 connection.close(); 84 } 85 catch (SQLException sqle) 86 { 87 System.err.println(sqle.getMessage()); 88 } 89 } 90 } 91 | Popular Tags |