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