1 2 10 11 package org.objectweb.rmijdbc; 12 13 import java.sql.*; 14 import java.rmi.RemoteException ; 15 16 29 public class RJStatement implements java.sql.Statement , java.io.Serializable 30 { 31 32 RJStatementInterface rmiStatement_; 33 Connection connection_; 34 35 public RJStatement(RJStatementInterface s, Connection c) { 36 rmiStatement_ = s; 37 connection_ = c; 38 } 39 40 47 public java.sql.ResultSet executeQuery(String sql) throws SQLException { 48 try { 49 return new RJResultSet(rmiStatement_.executeQuery(sql), this); 50 } catch(RemoteException e) { 51 throw new java.sql.SQLException (e.getMessage()); 52 } 53 } 54 55 65 public int executeUpdate(String sql) throws SQLException { 66 try { 67 return rmiStatement_.executeUpdate(sql); 68 } catch(RemoteException e) { 69 throw new java.sql.SQLException (e.getMessage()); 70 } 71 } 72 73 83 public void close() throws SQLException { 84 try { 85 rmiStatement_.close(); 86 } catch(RemoteException e) { 87 throw new java.sql.SQLException (e.getMessage()); 88 } 89 } 90 91 93 102 public int getMaxFieldSize() throws SQLException { 103 try { 104 return rmiStatement_.getMaxFieldSize(); 105 } catch(RemoteException e) { 106 throw new java.sql.SQLException (e.getMessage()); 107 } 108 } 109 110 120 public void setMaxFieldSize(int max) throws SQLException { 121 try { 122 rmiStatement_.setMaxFieldSize(max); 123 } catch(RemoteException e) { 124 throw new java.sql.SQLException (e.getMessage()); 125 } 126 } 127 128 135 public int getMaxRows() throws SQLException { 136 try { 137 return rmiStatement_.getMaxRows(); 138 } catch(RemoteException e) { 139 throw new java.sql.SQLException (e.getMessage()); 140 } 141 } 142 143 150 public void setMaxRows(int max) throws SQLException { 151 try { 152 rmiStatement_.setMaxRows(max); 153 } catch(RemoteException e) { 154 throw new java.sql.SQLException (e.getMessage()); 155 } 156 } 157 158 164 public void setEscapeProcessing(boolean enable) throws SQLException { 165 try { 166 rmiStatement_.setEscapeProcessing(enable); 167 } catch(RemoteException e) { 168 throw new java.sql.SQLException (e.getMessage()); 169 } 170 } 171 172 179 public int getQueryTimeout() throws SQLException { 180 try { 181 return rmiStatement_.getQueryTimeout(); 182 } catch(RemoteException e) { 183 throw new java.sql.SQLException (e.getMessage()); 184 } 185 } 186 187 194 public void setQueryTimeout(int seconds) throws SQLException { 195 try { 196 rmiStatement_.setQueryTimeout(seconds); 197 } catch(RemoteException e) { 198 throw new java.sql.SQLException (e.getMessage()); 199 } 200 } 201 202 206 public void cancel() throws SQLException { 207 try { 208 rmiStatement_.cancel(); 209 } catch(RemoteException e) { 210 throw new java.sql.SQLException (e.getMessage()); 211 } 212 } 213 214 229 public SQLWarning getWarnings() throws SQLException { 230 try { 231 return rmiStatement_.getWarnings(); 232 } catch(RemoteException e) { 233 throw new java.sql.SQLException (e.getMessage()); 234 } 235 } 236 237 241 public void clearWarnings() throws SQLException { 242 try { 243 rmiStatement_.clearWarnings(); 244 } catch(RemoteException e) { 245 throw new java.sql.SQLException (e.getMessage()); 246 } 247 } 248 249 264 public void setCursorName(String name) throws SQLException { 265 try { 266 rmiStatement_.setCursorName(name); 267 } catch(RemoteException e) { 268 throw new java.sql.SQLException (e.getMessage()); 269 } 270 } 271 272 274 295 public boolean execute(String sql) throws SQLException { 296 try { 297 return rmiStatement_.execute(sql); 298 } catch(RemoteException e) { 299 throw new java.sql.SQLException (e.getMessage()); 300 } 301 } 302 303 311 public java.sql.ResultSet getResultSet() throws SQLException { 312 ResultSet rs = null; 313 try { 314 RJResultSetInterface rjrsi = rmiStatement_.getResultSet(); 315 316 if (rjrsi != null) { 320 rs = new RJResultSet(rjrsi, this); 321 } 322 323 } catch(RemoteException e) { 324 throw new java.sql.SQLException (e.getMessage()); 325 } 326 327 return rs; 328 } 329 330 339 public int getUpdateCount() throws SQLException { 340 try { 341 return rmiStatement_.getUpdateCount(); 342 } catch(RemoteException e) { 343 throw new java.sql.SQLException (e.getMessage()); 344 } 345 } 346 347 359 public boolean getMoreResults() throws SQLException { 360 try { 361 return rmiStatement_.getMoreResults(); 362 } catch(RemoteException e) { 363 throw new java.sql.SQLException (e.getMessage()); 364 } 365 } 366 367 public void setFetchSize(int rows) throws SQLException { 369 try { 370 rmiStatement_.setFetchSize(rows); 371 } catch(RemoteException e) { 372 throw new java.sql.SQLException (e.getMessage()); 373 } 374 } 375 376 public void setFetchDirection(int dir) throws SQLException { 377 try { 378 rmiStatement_.setFetchDirection(dir); 379 } catch(RemoteException e) { 380 throw new java.sql.SQLException (e.getMessage()); 381 } 382 } 383 384 public int getResultSetType() throws SQLException { 385 try { 386 return rmiStatement_.getResultSetType(); 387 } catch(RemoteException e) { 388 throw new java.sql.SQLException (e.getMessage()); 389 } 390 } 391 392 public int getResultSetConcurrency() throws SQLException { 393 try { 394 return rmiStatement_.getResultSetConcurrency(); 395 } catch(RemoteException e) { 396 throw new java.sql.SQLException (e.getMessage()); 397 } 398 } 399 400 public int getFetchSize() throws SQLException { 401 try { 402 return rmiStatement_.getFetchSize(); 403 } catch(RemoteException e) { 404 throw new java.sql.SQLException (e.getMessage()); 405 } 406 } 407 408 public int getFetchDirection() throws SQLException { 409 try { 410 return rmiStatement_.getFetchDirection(); 411 } catch(RemoteException e) { 412 throw new java.sql.SQLException (e.getMessage()); 413 } 414 } 415 416 public Connection getConnection() throws SQLException { 417 return connection_; 418 } 419 420 public int[] executeBatch() throws SQLException { 421 try { 422 return rmiStatement_.executeBatch(); 423 } catch(RemoteException e) { 424 throw new java.sql.SQLException (e.getMessage()); 425 } 426 } 427 428 public void clearBatch() throws SQLException { 429 try { 430 rmiStatement_.clearBatch(); 431 } catch(RemoteException e) { 432 throw new java.sql.SQLException (e.getMessage()); 433 } 434 } 435 436 public void addBatch(String sql) throws SQLException { 437 try { 438 rmiStatement_.addBatch(sql); 439 } catch(RemoteException e) { 440 throw new java.sql.SQLException (e.getMessage()); 441 } 442 } 443 444 public boolean getMoreResults(int current) throws SQLException { 446 try { 447 return rmiStatement_.getMoreResults(current); 448 } catch(RemoteException e) { 449 throw new java.sql.SQLException (e.getMessage()); 450 } 451 } 452 453 public ResultSet getGeneratedKeys() throws SQLException { 454 try { 455 return new RJResultSet(rmiStatement_.getGeneratedKeys(), this); 456 } catch(RemoteException e) { 457 throw new java.sql.SQLException (e.getMessage()); 458 } 459 } 460 461 public int executeUpdate(String sql, int autoGeneratedKeys) 462 throws SQLException { 463 try { 464 return rmiStatement_.executeUpdate(sql,autoGeneratedKeys); 465 } catch(RemoteException e) { 466 throw new java.sql.SQLException (e.getMessage()); 467 } 468 } 469 470 public int executeUpdate(String sql, int columnIndexes[]) 471 throws SQLException { 472 try { 473 return rmiStatement_.executeUpdate(sql, columnIndexes); 474 } catch(RemoteException e) { 475 throw new java.sql.SQLException (e.getMessage()); 476 } 477 } 478 479 public int executeUpdate(String sql, String columnNames[]) 480 throws SQLException { 481 try { 482 return rmiStatement_.executeUpdate(sql, columnNames); 483 } catch(RemoteException e) { 484 throw new java.sql.SQLException (e.getMessage()); 485 } 486 } 487 488 public boolean execute(String sql, int autoGeneratedKeys) 489 throws SQLException { 490 try { 491 return rmiStatement_.execute(sql, autoGeneratedKeys); 492 } catch(RemoteException e) { 493 throw new java.sql.SQLException (e.getMessage()); 494 } 495 } 496 497 public boolean execute(String sql, int columnIndexes[]) throws SQLException { 498 try { 499 return rmiStatement_.execute(sql, columnIndexes); 500 } catch(RemoteException e) { 501 throw new java.sql.SQLException (e.getMessage()); 502 } 503 } 504 505 public boolean execute(String sql, String columnNames[]) throws SQLException { 506 try { 507 return rmiStatement_.execute(sql, columnNames); 508 } catch(RemoteException e) { 509 throw new java.sql.SQLException (e.getMessage()); 510 } 511 } 512 513 public int getResultSetHoldability() throws SQLException { 514 try { 515 return rmiStatement_.getResultSetHoldability(); 516 } catch(RemoteException e) { 517 throw new java.sql.SQLException (e.getMessage()); 518 } 519 } 520 }; 521 522 | Popular Tags |