1 package in.co.daffodil.db.jdbc; 2 3 import java.sql.Connection ; 4 import java.sql.Statement ; 5 import java.sql.SQLException ; 6 import java.sql.PreparedStatement ; 7 import java.sql.CallableStatement ; 8 import java.sql.DatabaseMetaData ; 9 import java.sql.SQLWarning ; 10 import java.util.Map ; 11 import java.sql.*; 12 13 public class DBClientConnection implements Connection { 14 15 DBPooledConnection dbPooledConnection; 16 Connection connection; 17 18 public DBClientConnection(DBPooledConnection dbPooledConnection0,Connection connection0){ 19 dbPooledConnection = dbPooledConnection0; 20 connection = connection0; 21 } 22 23 public Statement createStatement() throws SQLException { 24 return connection.createStatement(); 25 } 26 public PreparedStatement prepareStatement(String sql) throws SQLException { 27 return connection.prepareStatement(sql); 28 } 29 public CallableStatement prepareCall(String sql) throws SQLException { 30 return connection.prepareCall(sql); 31 } 32 33 public String nativeSQL(String sql) throws SQLException { 34 return connection.nativeSQL(sql); 35 } 36 37 public void setAutoCommit(boolean autoCommit) throws SQLException { 38 if ( dbPooledConnection.inGlobatTransaction() ) 39 throw new SQLException ( "Cannot commit/rollback a connection managed by the transaction manager" ); 40 connection.setAutoCommit(autoCommit); 41 } 42 43 public boolean getAutoCommit() throws SQLException { 44 return connection.getAutoCommit(); 45 } 46 47 public void commit() throws SQLException { 48 if ( dbPooledConnection.inGlobatTransaction() ) 49 throw new SQLException ( "Cannot commit/rollback a connection managed by the transaction manager" ); 50 connection.commit(); 51 } 52 53 public void rollback() throws SQLException { 54 connection.rollback(); 55 } 56 57 public void close() throws SQLException { 58 if ( dbPooledConnection.inGlobatTransaction() ) 59 dbPooledConnection.notifyClose(); 60 } 61 62 public boolean isClosed() throws SQLException { 63 return !dbPooledConnection.inGlobatTransaction() ; 64 } 65 66 public DatabaseMetaData getMetaData() throws SQLException { 67 return connection.getMetaData(); 68 } 69 70 public void setReadOnly(boolean readOnly) throws SQLException { 71 connection.setReadOnly(readOnly); 72 } 73 74 public boolean isReadOnly() throws SQLException { 75 return connection.isReadOnly(); 76 } 77 78 public void setCatalog(String catalog) throws SQLException { 79 connection.setCatalog(catalog); 80 } 81 82 public String getCatalog() throws SQLException { 83 return connection.getCatalog(); 84 } 85 86 public void setTransactionIsolation(int level) throws SQLException { 87 connection.setTransactionIsolation(level); 88 } 89 90 public int getTransactionIsolation() throws SQLException { 91 return connection.getTransactionIsolation(); 92 } 93 94 public SQLWarning getWarnings() throws SQLException { 95 return connection.getWarnings(); 96 } 97 98 public void clearWarnings() throws SQLException { 99 connection.clearWarnings(); 100 } 101 102 public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { 103 return connection.createStatement(resultSetType,resultSetConcurrency); 104 } 105 106 public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { 107 return connection.prepareStatement(sql,resultSetType,resultSetConcurrency); 108 } 109 110 public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException { 111 return connection.prepareCall(sql,resultSetType,resultSetConcurrency); 112 } 113 114 public Map getTypeMap() throws SQLException { 115 return connection.getTypeMap(); 116 } 117 118 public void setTypeMap(Map map) throws SQLException { 119 connection.setTypeMap(map); 120 } 121 public void setHoldability(int holdability) throws SQLException { 122 123 throw new java.lang.UnsupportedOperationException ("Method setHoldability() not yet implemented."); 124 } 125 public int getHoldability() throws SQLException { 126 127 throw new java.lang.UnsupportedOperationException ("Method getHoldability() not yet implemented."); 128 } 129 public Savepoint setSavepoint() throws SQLException { 130 131 throw new java.lang.UnsupportedOperationException ("Method setSavepoint() not yet implemented."); 132 } 133 public Savepoint setSavepoint(String name) throws SQLException { 134 135 throw new java.lang.UnsupportedOperationException ("Method setSavepoint() not yet implemented."); 136 } 137 public void rollback(Savepoint savepoint) throws SQLException { 138 139 throw new java.lang.UnsupportedOperationException ("Method rollback() not yet implemented."); 140 } 141 public void releaseSavepoint(Savepoint savepoint) throws SQLException { 142 143 throw new java.lang.UnsupportedOperationException ("Method releaseSavepoint() not yet implemented."); 144 } 145 public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { 146 147 throw new java.lang.UnsupportedOperationException ("Method createStatement() not yet implemented."); 148 } 149 public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { 150 151 throw new java.lang.UnsupportedOperationException ("Method prepareStatement() not yet implemented."); 152 } 153 public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { 154 155 throw new java.lang.UnsupportedOperationException ("Method prepareCall() not yet implemented."); 156 } 157 public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { 158 159 throw new java.lang.UnsupportedOperationException ("Method prepareStatement() not yet implemented."); 160 } 161 public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { 162 163 throw new java.lang.UnsupportedOperationException ("Method prepareStatement() not yet implemented."); 164 } 165 public PreparedStatement prepareStatement(String sql, String [] columnNames) throws SQLException { 166 167 throw new java.lang.UnsupportedOperationException ("Method prepareStatement() not yet implemented."); 168 } 169 } 170 | Popular Tags |