1 2 9 10 package org.objectweb.rmijdbc; 11 12 import java.sql.*; 13 14 import java.rmi.*; 15 import java.rmi.server.Unreferenced ; 16 17 import java.util.Calendar ; 18 19 24 40 41 public class RJPreparedStatementServer 42 extends RJStatementServer 43 implements RJPreparedStatementInterface, Unreferenced { 44 45 java.sql.PreparedStatement jdbcPrepStmt_; 46 47 public RJPreparedStatementServer(java.sql.PreparedStatement p) 48 throws RemoteException { 49 super(p); 50 jdbcPrepStmt_ = p; 51 } 52 53 public void unreferenced() { Runtime.getRuntime().gc(); } 54 55 61 public RJResultSetInterface executeQuery() 62 throws RemoteException, SQLException { 63 return new RJResultSetServer(jdbcPrepStmt_.executeQuery()); 64 } 65 66 74 public int executeUpdate() throws RemoteException, SQLException { 75 return jdbcPrepStmt_.executeUpdate(); 76 } 77 78 86 public void setNull(int parameterIndex, int sqlType) 87 throws RemoteException, SQLException { 88 jdbcPrepStmt_.setNull(parameterIndex, sqlType); 89 } 90 91 98 public void setBoolean(int parameterIndex, boolean x) 99 throws RemoteException, SQLException { 100 jdbcPrepStmt_.setBoolean(parameterIndex, x); 101 } 102 103 110 public void setByte(int parameterIndex, byte x) 111 throws RemoteException, SQLException { 112 jdbcPrepStmt_.setByte(parameterIndex, x); 113 } 114 115 122 public void setShort(int parameterIndex, short x) 123 throws RemoteException, SQLException { 124 jdbcPrepStmt_.setShort(parameterIndex, x); 125 } 126 127 134 public void setInt(int parameterIndex, int x) 135 throws RemoteException, SQLException { 136 jdbcPrepStmt_.setInt(parameterIndex, x); 137 } 138 139 146 public void setLong(int parameterIndex, long x) 147 throws RemoteException, SQLException { 148 jdbcPrepStmt_.setLong(parameterIndex, x); 149 } 150 151 158 public void setFloat(int parameterIndex, float x) 159 throws RemoteException, SQLException { 160 jdbcPrepStmt_.setFloat(parameterIndex, x); 161 } 162 163 170 public void setDouble(int parameterIndex, double x) 171 throws RemoteException, SQLException { 172 jdbcPrepStmt_.setDouble(parameterIndex, x); 173 } 174 175 182 public void setBigDecimal(int parameterIndex, java.math.BigDecimal x) 183 throws RemoteException, SQLException { 184 jdbcPrepStmt_.setBigDecimal(parameterIndex, x); 185 } 186 187 196 public void setString(int parameterIndex, String x) 197 throws RemoteException, SQLException { 198 jdbcPrepStmt_.setString(parameterIndex, x); 199 } 200 201 210 public void setBytes(int parameterIndex, byte x[]) 211 throws RemoteException, SQLException { 212 jdbcPrepStmt_.setBytes(parameterIndex, x); 213 } 214 215 222 public void setDate(int parameterIndex, java.sql.Date x) 223 throws RemoteException, SQLException { 224 jdbcPrepStmt_.setDate(parameterIndex, x); 225 } 226 227 234 public void setTime(int parameterIndex, java.sql.Time x) 235 throws RemoteException, SQLException { 236 jdbcPrepStmt_.setTime(parameterIndex, x); 237 } 238 239 247 public void setTimestamp(int parameterIndex, java.sql.Timestamp x) 248 throws RemoteException, SQLException { 249 jdbcPrepStmt_.setTimestamp(parameterIndex, x); 250 } 251 252 267 public void setAsciiStream(int parameterIndex, byte[] x, 270 int length) throws RemoteException, SQLException { 271 jdbcPrepStmt_.setAsciiStream(parameterIndex, 273 new java.io.ByteArrayInputStream (x), length); 274 } 275 276 292 public void setUnicodeStream(int parameterIndex, byte[] x, 295 int length) throws RemoteException, SQLException { 296 jdbcPrepStmt_.setUnicodeStream(parameterIndex, 298 new java.io.ByteArrayInputStream (x), length); 299 } 300 301 315 public void setBinaryStream(int parameterIndex, byte[] x, 318 int length) throws RemoteException, SQLException { 319 jdbcPrepStmt_.setBinaryStream(parameterIndex, 321 new java.io.ByteArrayInputStream (x), length); 322 } 323 324 331 public void clearParameters() throws RemoteException, SQLException { 332 jdbcPrepStmt_.clearParameters(); 333 } 334 335 338 359 public void setObject(int parameterIndex, Object x, int targetSqlType, 360 int scale) throws RemoteException, SQLException { 361 jdbcPrepStmt_.setObject(parameterIndex, x, targetSqlType, scale); 362 } 363 364 367 public void setObject(int parameterIndex, Object x, int targetSqlType) 368 throws RemoteException, SQLException { 369 jdbcPrepStmt_.setObject(parameterIndex, x, targetSqlType); 370 } 371 372 388 public void setObject(int parameterIndex, Object x) 389 throws RemoteException, SQLException { 390 jdbcPrepStmt_.setObject(parameterIndex, x); 391 } 392 393 400 public boolean execute() throws RemoteException, SQLException { 401 return jdbcPrepStmt_.execute(); 402 } 403 404 407 415 public void addBatch() throws RemoteException, SQLException { 416 jdbcPrepStmt_.addBatch(); 417 } 418 419 439 public void setCharacterStream(int parameterIndex, 441 java.io.Reader reader, 442 int length) throws RemoteException, SQLException { 443 jdbcPrepStmt_.setCharacterStream(parameterIndex,reader,length); 444 } 445 public void setCharacterStream(int parameterIndex, 446 char buf[], int length) throws RemoteException, SQLException { 447 try { 448 setCharacterStream(parameterIndex, 449 RJSerializer.toReader(buf),length); 450 } catch(Exception e) { 451 throw new SQLException(e.getMessage()); 452 } 453 } 454 455 464 public void setRef (int i, Ref x) throws RemoteException, SQLException { 465 jdbcPrepStmt_.setRef (i, x); 466 } 467 468 477 public void setBlob (int i, Blob x) throws RemoteException, SQLException { 478 jdbcPrepStmt_.setBlob (i, x); 479 } 480 481 490 public void setClob (int i, Clob x) throws RemoteException, SQLException { 491 jdbcPrepStmt_.setClob (i, x); 492 } 493 494 503 public void setArray (int i, Array x) throws RemoteException, SQLException { 504 jdbcPrepStmt_.setArray (i, x); 505 } 506 507 515 public RJResultSetMetaDataInterface getMetaData() 516 throws RemoteException, SQLException { 517 return new RJResultSetMetaDataServer(jdbcPrepStmt_.getMetaData()); 518 } 519 520 538 public void setDate(int parameterIndex, java.sql.Date x, Calendar cal) 539 throws RemoteException, SQLException { 540 jdbcPrepStmt_.setDate(parameterIndex, x, cal); 541 } 542 543 561 public void setTime(int parameterIndex, java.sql.Time x, Calendar cal) 562 throws RemoteException, SQLException { 563 jdbcPrepStmt_.setTime(parameterIndex, x, cal) ; 564 } 565 566 584 public void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) 585 throws RemoteException, SQLException { 586 jdbcPrepStmt_.setTimestamp(parameterIndex, x, cal); 587 } 588 589 617 public void setNull (int paramIndex, int sqlType, String typeName) 618 throws RemoteException, SQLException { 619 jdbcPrepStmt_.setNull (paramIndex, sqlType, typeName); 620 } 621 622 624 634 public void setURL(int parameterIndex, java.net.URL x) 635 throws java.rmi.RemoteException , SQLException { 636 jdbcPrepStmt_.setURL(parameterIndex, x); 637 } 638 639 650 public RJParameterMetaDataInterface getParameterMetaData() 651 throws java.rmi.RemoteException , SQLException { 652 return new RJParameterMetaDataServer(jdbcPrepStmt_.getParameterMetaData()); 653 } 654 655 }; 656 657 | Popular Tags |