1 package net.sourceforge.jdbclogger.core; 2 18 import java.sql.*; 19 import java.util.List ; 20 import java.util.Map ; 21 25 public class ConnectionWrapper implements Connection 26 { 27 private Connection _connection; 28 protected List _formatters; 29 30 public ConnectionWrapper(Connection connection, List formatters) 31 { 32 _connection = connection; 33 _formatters = formatters; 34 } 35 36 public int getHoldability() throws SQLException 37 { 38 return _connection.getHoldability(); 39 } 40 41 public int getTransactionIsolation() throws SQLException 42 { 43 return _connection.getTransactionIsolation(); 44 } 45 46 public void clearWarnings() throws SQLException 47 { 48 _connection.clearWarnings(); 49 } 50 51 public void close() throws SQLException 52 { 53 _connection.close(); 54 } 55 56 public void commit() throws SQLException 57 { 58 _connection.commit(); 59 } 60 61 public void rollback() throws SQLException 62 { 63 _connection.rollback(); 64 } 65 66 public boolean getAutoCommit() throws SQLException 67 { 68 return _connection.getAutoCommit(); 69 } 70 71 public boolean isClosed() throws SQLException 72 { 73 return _connection.isClosed(); 74 } 75 76 public boolean isReadOnly() throws SQLException 77 { 78 return _connection.isReadOnly(); 79 } 80 81 public void setHoldability(int holdability) throws SQLException 82 { 83 _connection.setHoldability(holdability); 84 } 85 86 public void setTransactionIsolation(int level) throws SQLException 87 { 88 _connection.setTransactionIsolation(level); 89 } 90 91 public void setAutoCommit(boolean autoCommit) throws SQLException 92 { 93 _connection.setAutoCommit(autoCommit); 94 } 95 96 public void setReadOnly(boolean readOnly) throws SQLException 97 { 98 _connection.setReadOnly(readOnly); 99 } 100 101 public String getCatalog() throws SQLException 102 { 103 return _connection.getCatalog(); 104 } 105 106 public void setCatalog(String catalog) throws SQLException 107 { 108 _connection.setCatalog(catalog); 109 } 110 111 public DatabaseMetaData getMetaData() throws SQLException 112 { 113 return _connection.getMetaData(); 114 } 115 116 public SQLWarning getWarnings() throws SQLException 117 { 118 return _connection.getWarnings(); 119 } 120 121 public Savepoint setSavepoint() throws SQLException 122 { 123 return _connection.setSavepoint(); 124 } 125 126 public void releaseSavepoint(Savepoint savepoint) throws SQLException 127 { 128 _connection.releaseSavepoint(savepoint); 129 } 130 131 public void rollback(Savepoint savepoint) throws SQLException 132 { 133 _connection.rollback(savepoint); 134 } 135 136 public Map getTypeMap() throws SQLException 137 { 138 return _connection.getTypeMap(); 139 } 140 141 public void setTypeMap(Map map) throws SQLException 142 { 143 _connection.setTypeMap(map); 144 } 145 146 public String nativeSQL(String sql) throws SQLException 147 { 148 return _connection.nativeSQL(sql); 149 } 150 151 public Savepoint setSavepoint(String name) throws SQLException 152 { 153 return _connection.setSavepoint(name); 154 } 155 156 public CallableStatement prepareCall(String sql) throws SQLException 157 { 158 return _connection.prepareCall(sql); 159 } 160 161 public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) throws SQLException 162 { 163 return _connection.prepareCall(sql, resultSetType, resultSetConcurrency); 164 } 165 166 public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException 167 { 168 return _connection.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability); 169 } 170 171 public PreparedStatement prepareStatement(String sql) throws SQLException 172 { 173 return new PreparedStatementWrapper(_connection.prepareStatement(sql), sql, _formatters); 174 } 175 176 public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException 177 { 178 return new PreparedStatementWrapper( 179 _connection.prepareStatement(sql, autoGeneratedKeys),sql,_formatters); 180 } 181 182 public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) throws SQLException 183 { 184 return new PreparedStatementWrapper( 185 _connection.prepareStatement(sql, resultSetType, resultSetConcurrency),sql,_formatters); 186 } 187 188 public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException 189 { 190 return new PreparedStatementWrapper( 191 _connection.prepareStatement(sql, resultSetType, resultSetConcurrency),sql,_formatters); 192 } 193 194 public PreparedStatement prepareStatement(String sql, int columnIndexes[]) throws SQLException 195 { 196 return new PreparedStatementWrapper( 197 _connection.prepareStatement(sql, columnIndexes),sql,_formatters); 198 } 199 200 public PreparedStatement prepareStatement(String sql, String columnNames[]) throws SQLException 201 { 202 return new PreparedStatementWrapper( 203 _connection.prepareStatement(sql, columnNames),sql,_formatters); 204 } 205 206 public Statement createStatement() throws SQLException 207 { 208 return new StatementWrapper(_connection.createStatement()); 209 } 210 211 public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException 212 { 213 return new StatementWrapper(_connection.createStatement(resultSetType, resultSetConcurrency)); 214 } 215 216 public Statement createStatement(int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException 217 { 218 return new StatementWrapper(_connection.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability)); 219 } 220 221 222 } 223 | Popular Tags |