1 22 package org.jboss.test.jca.jdbc; 23 24 import java.sql.Connection ; 25 import java.sql.ResultSet ; 26 import java.sql.SQLException ; 27 import java.sql.SQLWarning ; 28 import java.sql.Statement ; 29 30 31 40 41 public class TestStatement 42 implements Statement 43 { 44 private final TestDriver driver; 45 46 int queryTimeout = 0; 47 48 public TestStatement(final TestDriver driver) 49 { 50 this.driver = driver; 51 } 52 54 58 public void close() throws SQLException 59 { 60 } 61 62 68 public boolean execute(String sql) throws SQLException 69 { 70 if (driver.getFail()) 71 { 72 throw new SQLException ("asked to fail"); 73 } return false; 75 76 } 77 78 85 public boolean execute(String sql, int autoGeneratedKeys) throws SQLException 86 { 87 return execute(sql); 88 } 89 90 97 public boolean execute(String sql, int[] columnIndexes) throws SQLException 98 { 99 return execute(sql); 100 } 101 102 109 public boolean execute(String sql, String []columnNames ) throws SQLException 110 { 111 return execute(sql); 112 } 113 114 119 public Connection getConnection() throws SQLException 120 { 121 return null; 122 } 123 124 129 public SQLWarning getWarnings() throws SQLException 130 { 131 return null; 132 } 133 134 138 public void clearWarnings() throws SQLException 139 { 140 } 141 142 148 public ResultSet executeQuery(String sql) throws SQLException 149 { 150 execute(sql); 151 return null; 152 } 153 154 160 public int executeUpdate(String sql) throws SQLException 161 { 162 execute(sql); 163 return 0; 164 } 165 166 173 public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException 174 { 175 return executeUpdate(sql); 176 } 177 178 185 public int executeUpdate(String sql, int[] columnIndexes) throws SQLException 186 { 187 return executeUpdate(sql); 188 } 189 190 197 public int executeUpdate(String sql, String [] columnNames) throws SQLException 198 { 199 return executeUpdate(sql); 200 } 201 202 207 public int getMaxFieldSize() throws SQLException 208 { 209 return 0; 210 } 211 212 217 public void setMaxFieldSize(int max) throws SQLException 218 { 219 } 220 221 226 public int getMaxRows() throws SQLException 227 { 228 return 0; 229 } 230 231 236 public void setMaxRows(int max) throws SQLException 237 { 238 } 239 240 245 public void setEscapeProcessing(boolean enable) throws SQLException 246 { 247 } 248 249 254 public int getQueryTimeout() throws SQLException 255 { 256 return queryTimeout; 257 } 258 259 264 public void setQueryTimeout(int timeout) throws SQLException 265 { 266 this.queryTimeout = timeout; 267 } 268 269 273 public void cancel() throws SQLException 274 { 275 } 276 277 282 public void setCursorName(String name) throws SQLException 283 { 284 } 285 286 291 public ResultSet getResultSet() throws SQLException 292 { 293 return null; 294 } 295 296 301 public int getUpdateCount() throws SQLException 302 { 303 return 0; 304 } 305 306 311 public boolean getMoreResults() throws SQLException 312 { 313 return false; 314 } 315 316 322 public boolean getMoreResults(int current) throws SQLException 323 { 324 return false; 325 } 326 327 332 public void setFetchDirection(int direction) throws SQLException 333 { 334 } 335 336 341 public int getFetchDirection() throws SQLException 342 { 343 return 0; 344 } 345 346 351 public void setFetchSize(int rows) throws SQLException 352 { 353 } 354 355 360 public int getFetchSize() throws SQLException 361 { 362 return 0; 363 } 364 365 370 public int getResultSetConcurrency() throws SQLException 371 { 372 return 0; 373 } 374 375 380 public int getResultSetType() throws SQLException 381 { 382 return 0; 383 } 384 385 390 public void addBatch(String sql) throws SQLException 391 { 392 } 393 394 398 public void clearBatch() throws SQLException 399 { 400 } 401 402 407 public int[] executeBatch() throws SQLException 408 { 409 return null; 410 } 411 412 417 public ResultSet getGeneratedKeys() throws SQLException 418 { 419 return null; 420 } 421 422 427 public int getResultSetHoldability() throws SQLException 428 { 429 return 0; 430 } 431 432 433 } | Popular Tags |