001package org.avaje.datasource.delegate; 002 003import java.sql.*; 004import java.util.Map; 005import java.util.Properties; 006import java.util.concurrent.Executor; 007 008public class ConnectionDelegator implements Connection { 009 010 private final Connection delegate; 011 012 public ConnectionDelegator(Connection delegate) { 013 this.delegate = delegate; 014 } 015 016 @Override 017 public void setSchema(String schema) throws SQLException { 018 delegate.setSchema(schema); 019 } 020 021 @Override 022 public String getSchema() throws SQLException { 023 return delegate.getSchema(); 024 } 025 026 @Override 027 public void abort(Executor executor) throws SQLException { 028 delegate.abort(executor); 029 } 030 031 @Override 032 public void setNetworkTimeout(Executor executor, int milliseconds) throws SQLException { 033 delegate.setNetworkTimeout(executor, milliseconds); 034 } 035 036 @Override 037 public int getNetworkTimeout() throws SQLException { 038 return delegate.getNetworkTimeout(); 039 } 040 041 public Statement createStatement() throws SQLException { 042 return delegate.createStatement(); 043 } 044 045 public PreparedStatement prepareStatement(String sql) throws SQLException { 046 return delegate.prepareStatement(sql); 047 } 048 049 public CallableStatement prepareCall(String sql) throws SQLException { 050 return delegate.prepareCall(sql); 051 } 052 053 public String nativeSQL(String sql) throws SQLException { 054 return delegate.nativeSQL(sql); 055 } 056 057 public void setAutoCommit(boolean autoCommit) throws SQLException { 058 delegate.setAutoCommit(autoCommit); 059 } 060 061 public boolean getAutoCommit() throws SQLException { 062 return delegate.getAutoCommit(); 063 } 064 065 public void commit() throws SQLException { 066 delegate.commit(); 067 } 068 069 public void rollback() throws SQLException { 070 delegate.rollback(); 071 } 072 073 public void close() throws SQLException { 074 delegate.close(); 075 } 076 077 public boolean isClosed() throws SQLException { 078 return delegate.isClosed(); 079 } 080 081 public DatabaseMetaData getMetaData() throws SQLException { 082 return delegate.getMetaData(); 083 } 084 085 public void setReadOnly(boolean readOnly) throws SQLException { 086 delegate.setReadOnly(readOnly); 087 } 088 089 public boolean isReadOnly() throws SQLException { 090 return delegate.isReadOnly(); 091 } 092 093 public void setCatalog(String catalog) throws SQLException { 094 delegate.setCatalog(catalog); 095 } 096 097 public String getCatalog() throws SQLException { 098 return delegate.getCatalog(); 099 } 100 101 public void setTransactionIsolation(int level) throws SQLException { 102 delegate.setTransactionIsolation(level); 103 } 104 105 public int getTransactionIsolation() throws SQLException { 106 return delegate.getTransactionIsolation(); 107 } 108 109 public SQLWarning getWarnings() throws SQLException { 110 return delegate.getWarnings(); 111 } 112 113 public void clearWarnings() throws SQLException { 114 delegate.clearWarnings(); 115 } 116 117 public Statement createStatement(int resultSetType, int resultSetConcurrency) throws SQLException { 118 return delegate.createStatement(resultSetType, resultSetConcurrency); 119 } 120 121 public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency) 122 throws SQLException { 123 return delegate.prepareStatement(sql, resultSetType, resultSetConcurrency); 124 } 125 126 public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency) 127 throws SQLException { 128 return delegate.prepareCall(sql, resultSetType, resultSetConcurrency); 129 } 130 131 public Map<String, Class<?>> getTypeMap() throws SQLException { 132 return delegate.getTypeMap(); 133 } 134 135 public void setTypeMap(Map<String, Class<?>> map) throws SQLException { 136 delegate.setTypeMap(map); 137 } 138 139 public void setHoldability(int holdability) throws SQLException { 140 delegate.setHoldability(holdability); 141 } 142 143 public int getHoldability() throws SQLException { 144 return delegate.getHoldability(); 145 } 146 147 public Savepoint setSavepoint() throws SQLException { 148 return delegate.setSavepoint(); 149 } 150 151 public Savepoint setSavepoint(String name) throws SQLException { 152 return delegate.setSavepoint(name); 153 } 154 155 public void rollback(Savepoint savepoint) throws SQLException { 156 delegate.rollback(savepoint); 157 } 158 159 public void releaseSavepoint(Savepoint savepoint) throws SQLException { 160 delegate.releaseSavepoint(savepoint); 161 } 162 163 public Statement createStatement(int resultSetType, int resultSetConcurrency, 164 int resultSetHoldability) throws SQLException { 165 return delegate.createStatement(resultSetType, resultSetConcurrency, resultSetHoldability); 166 } 167 168 public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException { 169 return delegate.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability); 170 } 171 172 public CallableStatement prepareCall(String sql, int resultSetType, int resultSetConcurrency, 173 int resultSetHoldability) throws SQLException { 174 return delegate.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability); 175 } 176 177 public PreparedStatement prepareStatement(String sql, int autoGeneratedKeys) throws SQLException { 178 return delegate.prepareStatement(sql, autoGeneratedKeys); 179 } 180 181 public PreparedStatement prepareStatement(String sql, int[] columnIndexes) throws SQLException { 182 return delegate.prepareStatement(sql, columnIndexes); 183 } 184 185 public PreparedStatement prepareStatement(String sql, String[] columnNames) throws SQLException { 186 return delegate.prepareStatement(sql, columnNames); 187 } 188 189 public Clob createClob() throws SQLException { 190 return delegate.createClob(); 191 } 192 193 public Blob createBlob() throws SQLException { 194 return delegate.createBlob(); 195 } 196 197 public NClob createNClob() throws SQLException { 198 return delegate.createNClob(); 199 } 200 201 public SQLXML createSQLXML() throws SQLException { 202 return delegate.createSQLXML(); 203 } 204 205 public boolean isValid(int timeout) throws SQLException { 206 return delegate.isValid(timeout); 207 } 208 209 public void setClientInfo(String name, String value) throws SQLClientInfoException { 210 delegate.setClientInfo(name, value); 211 } 212 213 public void setClientInfo(Properties properties) throws SQLClientInfoException { 214 delegate.setClientInfo(properties); 215 } 216 217 public String getClientInfo(String name) throws SQLException { 218 return delegate.getClientInfo(name); 219 } 220 221 public Properties getClientInfo() throws SQLException { 222 return delegate.getClientInfo(); 223 } 224 225 public Array createArrayOf(String typeName, Object[] elements) throws SQLException { 226 return delegate.createArrayOf(typeName, elements); 227 } 228 229 public Struct createStruct(String typeName, Object[] attributes) throws SQLException { 230 return delegate.createStruct(typeName, attributes); 231 } 232 233 public <T> T unwrap(Class<T> iface) throws SQLException { 234 return delegate.unwrap(iface); 235 } 236 237 public boolean isWrapperFor(Class<?> iface) throws SQLException { 238 return delegate.isWrapperFor(iface); 239 } 240}