1 6 package org.logicalcobwebs.proxool; 7 8 import org.logicalcobwebs.logging.Log; 9 import org.logicalcobwebs.logging.LogFactory; 10 11 import java.sql.Connection ; 12 import java.sql.DatabaseMetaData ; 13 import java.sql.SQLException ; 14 15 25 public abstract class AbstractDatabaseMetaData { 26 27 private static final Log LOG = LogFactory.getLog(AbstractDatabaseMetaData.class); 28 29 private DatabaseMetaData databaseMetaData; 30 31 private ProxyConnectionIF proxyConnection; 32 33 36 private boolean needToReset = false; 37 38 protected AbstractDatabaseMetaData(Connection connection, ProxyConnectionIF proxyConnection) throws SQLException { 39 databaseMetaData = connection.getMetaData(); 40 this.proxyConnection = proxyConnection; 41 } 42 43 49 public boolean equals(Object obj) { 50 return databaseMetaData.hashCode() == obj.hashCode(); 51 } 52 53 59 public Connection getConnection() { 60 return ProxyFactory.getConnection(proxyConnection); 61 } 62 63 67 protected DatabaseMetaData getDatabaseMetaData() { 68 return databaseMetaData; 69 } 70 71 74 public String toString() { 75 return databaseMetaData.toString(); 76 } 77 78 } 79 80 81 | Popular Tags |