KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > rmijdbc > RJPreparedStatement


1
2 /**
3  * RmiJdbc client/server JDBC Driver
4  * (C) GIE Dyade (Groupe BULL / INRIA Research Center) 1997
5  *
6  * @version 1.0
7  * @author Pierre-Yves Gibello (pierreyves.gibello@experlog.com)
8  */

9
10 package org.objectweb.rmijdbc;
11
12 import java.sql.*;
13 import java.rmi.RemoteException JavaDoc;
14
15 import java.io.*;
16
17 // TBD: WARNING This file contains a hack for InputStream class...
18
// InputStream is not serializable, of course !
19
// The right way would be to encapsulate InputStream in a RMI remote object
20
// (hope I'll find time to do that)
21

22 /**
23  * <P>A SQL statement is pre-compiled and stored in a
24  * PreparedStatement object. This object can then be used to
25  * efficiently execute this statement multiple times.
26  *
27  * <P><B>Note:</B> The setXXX methods for setting IN parameter values
28  * must specify types that are compatible with the defined SQL type of
29  * the input parameter. For instance, if the IN parameter has SQL type
30  * Integer then setInt should be used.
31  *
32  * <p>If arbitrary parameter type conversions are required then the
33  * setObject method should be used with a target SQL type.
34  *
35  * @see Connection#prepareStatement
36  * @see ResultSet
37  */

38
39 public class RJPreparedStatement extends RJStatement
40 implements java.sql.PreparedStatement JavaDoc, java.io.Serializable JavaDoc {
41
42   RJPreparedStatementInterface rmiPrepStmt_;
43
44   public RJPreparedStatement(RJPreparedStatementInterface p, Connection c) {
45     super(p, c);
46     rmiPrepStmt_ = p;
47   }
48
49     /**
50      * A prepared SQL query is executed and its ResultSet is returned.
51      *
52      * @return a ResultSet that contains the data produced by the
53      * query; never null
54      */

55   public java.sql.ResultSet JavaDoc executeQuery() throws SQLException {
56     try {
57       return new RJResultSet(rmiPrepStmt_.executeQuery(), this);
58     } catch(RemoteException JavaDoc e) {
59       throw new java.sql.SQLException JavaDoc(e.getMessage());
60     }
61   }
62
63     /**
64      * Execute a SQL INSERT, UPDATE or DELETE statement. In addition,
65      * SQL statements that return nothing such as SQL DDL statements
66      * can be executed.
67      *
68      * @return either the row count for INSERT, UPDATE or DELETE; or 0
69      * for SQL statements that return nothing
70      */

71   public int executeUpdate() throws SQLException {
72     try {
73       return rmiPrepStmt_.executeUpdate();
74     } catch(RemoteException JavaDoc e) {
75       throw new java.sql.SQLException JavaDoc(e.getMessage());
76     }
77   }
78
79     /**
80      * Set a parameter to SQL NULL.
81      *
82      * <P><B>Note:</B> You must specify the parameter's SQL type.
83      *
84      * @param parameterIndex the first parameter is 1, the second is 2, ...
85      * @param sqlType SQL type code defined by java.sql.Types
86      */

87   public void setNull(int parameterIndex, int sqlType) throws SQLException {
88     try {
89       rmiPrepStmt_.setNull(parameterIndex, sqlType);
90     } catch(RemoteException JavaDoc e) {
91       throw new java.sql.SQLException JavaDoc(e.getMessage());
92     }
93   }
94
95     /**
96      * Set a parameter to a Java boolean value. The driver converts this
97      * to a SQL BIT value when it sends it to the database.
98      *
99      * @param parameterIndex the first parameter is 1, the second is 2, ...
100      * @param x the parameter value
101      */

102   public void setBoolean(int parameterIndex, boolean x) throws SQLException {
103     try {
104       rmiPrepStmt_.setBoolean(parameterIndex, x);
105     } catch(RemoteException JavaDoc e) {
106       throw new java.sql.SQLException JavaDoc(e.getMessage());
107     }
108   }
109
110     /**
111      * Set a parameter to a Java byte value. The driver converts this
112      * to a SQL TINYINT value when it sends it to the database.
113      *
114      * @param parameterIndex the first parameter is 1, the second is 2, ...
115      * @param x the parameter value
116      */

117   public void setByte(int parameterIndex, byte x) throws SQLException {
118     try {
119       rmiPrepStmt_.setByte(parameterIndex, x);
120     } catch(RemoteException JavaDoc e) {
121       throw new java.sql.SQLException JavaDoc(e.getMessage());
122     }
123   }
124
125     /**
126      * Set a parameter to a Java short value. The driver converts this
127      * to a SQL SMALLINT value when it sends it to the database.
128      *
129      * @param parameterIndex the first parameter is 1, the second is 2, ...
130      * @param x the parameter value
131      */

132   public void setShort(int parameterIndex, short x) throws SQLException {
133     try {
134       rmiPrepStmt_.setShort(parameterIndex, x);
135     } catch(RemoteException JavaDoc e) {
136       throw new java.sql.SQLException JavaDoc(e.getMessage());
137     }
138   }
139
140     /**
141      * Set a parameter to a Java int value. The driver converts this
142      * to a SQL INTEGER value when it sends it to the database.
143      *
144      * @param parameterIndex the first parameter is 1, the second is 2, ...
145      * @param x the parameter value
146      */

147   public void setInt(int parameterIndex, int x) throws SQLException {
148     try {
149       rmiPrepStmt_.setInt(parameterIndex, x);
150     } catch(RemoteException JavaDoc e) {
151       throw new java.sql.SQLException JavaDoc(e.getMessage());
152     }
153   }
154
155     /**
156      * Set a parameter to a Java long value. The driver converts this
157      * to a SQL BIGINT value when it sends it to the database.
158      *
159      * @param parameterIndex the first parameter is 1, the second is 2, ...
160      * @param x the parameter value
161      */

162   public void setLong(int parameterIndex, long x) throws SQLException {
163     try {
164       rmiPrepStmt_.setLong(parameterIndex, x);
165     } catch(RemoteException JavaDoc e) {
166       throw new java.sql.SQLException JavaDoc(e.getMessage());
167     }
168   }
169
170     /**
171      * Set a parameter to a Java float value. The driver converts this
172      * to a SQL FLOAT value when it sends it to the database.
173      *
174      * @param parameterIndex the first parameter is 1, the second is 2, ...
175      * @param x the parameter value
176      */

177   public void setFloat(int parameterIndex, float x) throws SQLException {
178     try {
179       rmiPrepStmt_.setFloat(parameterIndex, x);
180     } catch(RemoteException JavaDoc e) {
181       throw new java.sql.SQLException JavaDoc(e.getMessage());
182     }
183   }
184
185     /**
186      * Set a parameter to a Java double value. The driver converts this
187      * to a SQL DOUBLE value when it sends it to the database.
188      *
189      * @param parameterIndex the first parameter is 1, the second is 2, ...
190      * @param x the parameter value
191      */

192   public void setDouble(int parameterIndex, double x) throws SQLException {
193     try {
194       rmiPrepStmt_.setDouble(parameterIndex, x);
195     } catch(RemoteException JavaDoc e) {
196       throw new java.sql.SQLException JavaDoc(e.getMessage());
197     }
198   }
199
200     /**
201      * Set a parameter to a java.lang.BigDecimal value. The driver converts
202      * this to a SQL NUMERIC value when it sends it to the database.
203      *
204      * @param parameterIndex the first parameter is 1, the second is 2, ...
205      * @param x the parameter value
206      */

207   public void setBigDecimal(int parameterIndex, java.math.BigDecimal JavaDoc x)
208   throws SQLException {
209     try {
210       rmiPrepStmt_.setBigDecimal(parameterIndex, x);
211     } catch(RemoteException JavaDoc e) {
212       throw new java.sql.SQLException JavaDoc(e.getMessage());
213     }
214   }
215
216     /**
217      * Set a parameter to a Java String value. The driver converts this
218      * to a SQL VARCHAR or LONGVARCHAR value (depending on the arguments
219      * size relative to the driver's limits on VARCHARs) when it sends
220      * it to the database.
221      *
222      * @param parameterIndex the first parameter is 1, the second is 2, ...
223      * @param x the parameter value
224      */

225   public void setString(int parameterIndex, String JavaDoc x) throws SQLException {
226     try {
227       rmiPrepStmt_.setString(parameterIndex, x);
228     } catch(RemoteException JavaDoc e) {
229       throw new java.sql.SQLException JavaDoc(e.getMessage());
230     }
231   }
232
233     /**
234      * Set a parameter to a Java array of bytes. The driver converts
235      * this to a SQL VARBINARY or LONGVARBINARY (depending on the
236      * argument's size relative to the driver's limits on VARBINARYs)
237      * when it sends it to the database.
238      *
239      * @param parameterIndex the first parameter is 1, the second is 2, ...
240      * @param x the parameter value
241      */

242   public void setBytes(int parameterIndex, byte x[]) throws SQLException {
243     try {
244       rmiPrepStmt_.setBytes(parameterIndex, x);
245     } catch(RemoteException JavaDoc e) {
246       throw new java.sql.SQLException JavaDoc(e.getMessage());
247     }
248   }
249
250     /**
251      * Set a parameter to a java.sql.Date value. The driver converts this
252      * to a SQL DATE value when it sends it to the database.
253      *
254      * @param parameterIndex the first parameter is 1, the second is 2, ...
255      * @param x the parameter value
256      */

257   public void setDate(int parameterIndex, java.sql.Date JavaDoc x)
258   throws SQLException {
259     try {
260       rmiPrepStmt_.setDate(parameterIndex, x);
261     } catch(RemoteException JavaDoc e) {
262       throw new java.sql.SQLException JavaDoc(e.getMessage());
263     }
264   }
265
266     /**
267      * Set a parameter to a java.sql.Time value. The driver converts this
268      * to a SQL TIME value when it sends it to the database.
269      *
270      * @param parameterIndex the first parameter is 1, the second is 2, ...
271      * @param x the parameter value
272      */

273   public void setTime(int parameterIndex, java.sql.Time JavaDoc x)
274   throws SQLException {
275     try {
276       rmiPrepStmt_.setTime(parameterIndex, x);
277     } catch(RemoteException JavaDoc e) {
278       throw new java.sql.SQLException JavaDoc(e.getMessage());
279     }
280   }
281
282     /**
283      * Set a parameter to a java.sql.Timestamp value. The driver
284      * converts this to a SQL TIMESTAMP value when it sends it to the
285      * database.
286      *
287      * @param parameterIndex the first parameter is 1, the second is 2, ...
288      * @param x the parameter value
289      */

290   public void setTimestamp(int parameterIndex, java.sql.Timestamp JavaDoc x)
291   throws SQLException {
292     try {
293       rmiPrepStmt_.setTimestamp(parameterIndex, x);
294     } catch(RemoteException JavaDoc e) {
295       throw new java.sql.SQLException JavaDoc(e.getMessage());
296     }
297   }
298
299     /**
300      * When a very large ASCII value is input to a LONGVARCHAR
301      * parameter, it may be more practical to send it via a
302      * java.io.InputStream. JDBC will read the data from the stream
303      * as needed, until it reaches end-of-file. The JDBC driver will
304      * do any necessary conversion from ASCII to the database char format.
305      *
306      * <P><B>Note:</B> This stream object can either be a standard
307      * Java stream object or your own subclass that implements the
308      * standard interface.
309      *
310      * @param parameterIndex the first parameter is 1, the second is 2, ...
311      * @param x the java input stream which contains the ASCII parameter value
312      * @param length the number of bytes in the stream
313      */

314 //TBD InputStream is not serializable: I transmit all the data in a byte[]
315

316   public void setAsciiStream(int parameterIndex, java.io.InputStream JavaDoc x,
317   int length) throws SQLException {
318     try {
319 // rmiPrepStmt_.setAsciiStream(parameterIndex, x, length);
320

321 /**
322       // I read the whole InputStream into a StringBuffer, then send the
323       // StringBuffer's bytes to the server !! Awful, isn't it :(
324       // The right way is to "RMIze" InputStream, or what ??
325       StringBuffer buf = new StringBuffer();
326       BufferedReader r = new BufferedReader(new InputStreamReader(x));
327       char cbuf[] = new char[256];
328       int nb;
329       while((nb = r.read(cbuf, 0, 255)) >= 0) {
330         if(nb > 0) buf.append(cbuf, 0, nb);
331       }
332       r.close();
333
334       rmiPrepStmt_.setAsciiStream(parameterIndex, buf.toString().getBytes(),
335         length);
336 **/

337
338       BufferedInputStream s = new BufferedInputStream(x);
339       ByteArrayOutputStream bos = new ByteArrayOutputStream();
340       byte buf[] = new byte[256];
341       int br;
342       while((br = s.read(buf)) >= 0){
343         if (br > 0) bos.write(buf, 0, br);
344       }
345       s.close();
346       rmiPrepStmt_.setAsciiStream(parameterIndex, bos.toByteArray(), length);
347
348     } catch(RemoteException JavaDoc e) {
349       throw new java.sql.SQLException JavaDoc(e.getMessage());
350     } catch(IOException e) {
351       throw new java.sql.SQLException JavaDoc(e.getMessage());
352     }
353   }
354
355     /**
356      * When a very large UNICODE value is input to a LONGVARCHAR
357      * parameter, it may be more practical to send it via a
358      * java.io.InputStream. JDBC will read the data from the stream
359      * as needed, until it reaches end-of-file. The JDBC driver will
360      * do any necessary conversion from UNICODE to the database char format.
361      *
362      * <P><B>Note:</B> This stream object can either be a standard
363      * Java stream object or your own subclass that implements the
364      * standard interface.
365      *
366      * @param parameterIndex the first parameter is 1, the second is 2, ...
367      * @param x the java input stream which contains the
368      * UNICODE parameter value
369      * @param length the number of bytes in the stream
370      */

371 //TBD InputStream is not serializable: I transmit all the data in a byte[]
372

373   public void setUnicodeStream(int parameterIndex, java.io.InputStream JavaDoc x,
374   int length) throws SQLException {
375     try {
376 // rmiPrepStmt_.setUnicodeStream(parameterIndex, x, length);
377

378 /**
379       // I read the whole InputStream into a StringBuffer, then send the
380       // StringBuffer's bytes to the server !! Awful, isn't it :(
381       // The right way is to "RMIze" InputStream, or what ??
382       StringBuffer buf = new StringBuffer();
383       BufferedReader r = new BufferedReader(new InputStreamReader(x));
384       char cbuf[] = new char[256];
385       int nb;
386       while((nb = r.read(cbuf, 0, 255)) >= 0) {
387         if(nb > 0) buf.append(cbuf, 0, nb);
388       }
389       r.close();
390
391       rmiPrepStmt_.setUnicodeStream(parameterIndex, buf.toString().getBytes(),
392         length);
393 **/

394
395       BufferedInputStream s = new BufferedInputStream(x);
396       ByteArrayOutputStream bos = new ByteArrayOutputStream();
397       byte buf[] = new byte[256];
398       int br;
399       while((br = s.read(buf)) >= 0){
400         if (br > 0) bos.write(buf, 0, br);
401       }
402       s.close();
403       rmiPrepStmt_.setUnicodeStream(parameterIndex, bos.toByteArray(), length);
404
405     } catch(RemoteException JavaDoc e) {
406       throw new java.sql.SQLException JavaDoc(e.getMessage());
407     } catch(IOException e) {
408       throw new java.sql.SQLException JavaDoc(e.getMessage());
409     }
410   }
411
412     /**
413      * When a very large binary value is input to a LONGVARBINARY
414      * parameter, it may be more practical to send it via a
415      * java.io.InputStream. JDBC will read the data from the stream
416      * as needed, until it reaches end-of-file.
417      *
418      * <P><B>Note:</B> This stream object can either be a standard
419      * Java stream object or your own subclass that implements the
420      * standard interface.
421      *
422      * @param parameterIndex the first parameter is 1, the second is 2, ...
423      * @param x the java input stream which contains the binary parameter value
424      * @param length the number of bytes in the stream
425      */

426 //TBD InputStream is not serializable: I transmit all the data in a byte[]
427

428   public void setBinaryStream(int parameterIndex, java.io.InputStream JavaDoc x,
429   int length) throws SQLException {
430     try {
431 // rmiPrepStmt_.setBinaryStream(parameterIndex, x, length);
432
/*
433       // I read the whole InputStream into a StringBuffer, then send the
434       // StringBuffer's bytes to the server !! Awful, isn't it :(
435       // The right way is to "RMIze" InputStream, or what ??
436       StringBuffer buf = new StringBuffer();
437       BufferedReader r = new BufferedReader(new InputStreamReader(x));
438       char cbuf[] = new char[256];
439       int nb;
440       while((nb = r.read(cbuf, 0, 255)) >= 0) {
441         if(nb > 0) buf.append(cbuf, 0, nb);
442       }
443       r.close();
444
445       rmiPrepStmt_.setBinaryStream(parameterIndex, buf.toString().getBytes(),
446         length);
447 */

448
449       BufferedInputStream s = new BufferedInputStream(x);
450       ByteArrayOutputStream bos = new ByteArrayOutputStream();
451       byte buf[] = new byte[256];
452       int br;
453       while((br = s.read(buf)) >= 0){
454         if (br > 0) bos.write(buf, 0, br);
455       }
456       s.close();
457       rmiPrepStmt_.setBinaryStream(parameterIndex, bos.toByteArray(), length);
458
459 /** TBD Proposed by P.Hearty
460       rmiPrepStmt_.setBinaryStream(
461           parameterIndex,
462           RJResultSetServer.getBytesFromInputStream(x),
463           length);
464 **/

465     } catch(RemoteException JavaDoc e) {
466       throw new java.sql.SQLException JavaDoc(e.getMessage());
467     } catch(IOException e) {
468       throw new java.sql.SQLException JavaDoc(e.getMessage());
469     }
470   }
471
472     /**
473      * <P>In general, parameter values remain in force for repeated use of a
474      * Statement. Setting a parameter value automatically clears its
475      * previous value. However, in some cases it is useful to immediately
476      * release the resources used by the current parameter values; this can
477      * be done by calling clearParameters.
478      */

479   public void clearParameters() throws SQLException {
480     try {
481       rmiPrepStmt_.clearParameters();
482     } catch(RemoteException JavaDoc e) {
483       throw new java.sql.SQLException JavaDoc(e.getMessage());
484     }
485   }
486
487     //----------------------------------------------------------------------
488
// Advanced features:
489

490     /**
491      * <p>Set the value of a parameter using an object; use the
492      * java.lang equivalent objects for integral values.
493      *
494      * <p>The given Java object will be converted to the targetSqlType
495      * before being sent to the database.
496      *
497      * <p>Note that this method may be used to pass datatabase-
498      * specific abstract data types. This is done by using a Driver-
499      * specific Java type and using a targetSqlType of
500      * java.sql.types.OTHER.
501      *
502      * @param parameterIndex The first parameter is 1, the second is 2, ...
503      * @param x The object containing the input parameter value
504      * @param targetSqlType The SQL type (as defined in java.sql.Types) to be
505      * sent to the database. The scale argument may further qualify this type.
506      * @param scale For java.sql.Types.DECIMAL or java.sql.Types.NUMERIC types
507      * this is the number of digits after the decimal. For all other
508      * types this value will be ignored,
509      * @see Types
510      */

511   public void setObject(int parameterIndex, Object JavaDoc x, int targetSqlType,
512   int scale) throws SQLException {
513     try {
514       rmiPrepStmt_.setObject(parameterIndex, x, targetSqlType, scale);
515     } catch(RemoteException JavaDoc e) {
516       throw new java.sql.SQLException JavaDoc(e.getMessage());
517     }
518   }
519
520     /**
521       * This method is like setObject above, but assumes a scale of zero.
522       */

523   public void setObject(int parameterIndex, Object JavaDoc x, int targetSqlType)
524   throws SQLException {
525     try {
526       rmiPrepStmt_.setObject(parameterIndex, x, targetSqlType);
527     } catch(RemoteException JavaDoc e) {
528       throw new java.sql.SQLException JavaDoc(e.getMessage());
529     }
530   }
531
532     /**
533      * <p>Set the value of a parameter using an object; use the
534      * java.lang equivalent objects for integral values.
535      *
536      * <p>The JDBC specification specifies a standard mapping from
537      * Java Object types to SQL types. The given argument java object
538      * will be converted to the corresponding SQL type before being
539      * sent to the database.
540      *
541      * <p>Note that this method may be used to pass datatabase
542      * specific abstract data types, by using a Driver specific Java
543      * type.
544      *
545      * @param parameterIndex The first parameter is 1, the second is 2, ...
546      * @param x The object containing the input parameter value
547      */

548   public void setObject(int parameterIndex, Object JavaDoc x) throws SQLException {
549     try {
550       rmiPrepStmt_.setObject(parameterIndex, x);
551     } catch(RemoteException JavaDoc e) {
552       throw new java.sql.SQLException JavaDoc(e.getMessage());
553     }
554   }
555
556     /**
557      * Some prepared statements return multiple results; the execute
558      * method handles these complex statements as well as the simpler
559      * form of statements handled by executeQuery and executeUpdate.
560      *
561      * @see Statement#execute
562      */

563   public boolean execute() throws SQLException {
564     try {
565       return rmiPrepStmt_.execute();
566     } catch(RemoteException JavaDoc e) {
567       throw new java.sql.SQLException JavaDoc(e.getMessage());
568     }
569   }
570
571
572 // JDBC 2.0 methods added by Mike Jennings
573
// sometime in the summer of 1999
574
// Implementation added by Peter Hearty, Aug 2000, (peter.hearty@lutris.com).
575

576   public void setTimestamp(int parameterIndex, Timestamp x,
577   java.util.Calendar JavaDoc cal) throws SQLException {
578     try {
579       rmiPrepStmt_.setTimestamp(parameterIndex,x,cal);
580     } catch(RemoteException JavaDoc e) {
581       throw new java.sql.SQLException JavaDoc(e.getMessage());
582     }
583   }
584
585   public void setTime(int parameterIndex, Time x, java.util.Calendar JavaDoc cal)
586   throws SQLException {
587     try {
588       rmiPrepStmt_.setTime(parameterIndex,x,cal);
589     } catch(RemoteException JavaDoc e) {
590       throw new java.sql.SQLException JavaDoc(e.getMessage());
591     }
592   }
593
594   public void setRef(int i,Ref x) throws SQLException {
595     try {
596       rmiPrepStmt_.setRef(i,x);
597     } catch(RemoteException JavaDoc e) {
598       throw new java.sql.SQLException JavaDoc(e.getMessage());
599     }
600   }
601
602   public void setNull(int paramIndex, int sqlType, String JavaDoc typeName)
603   throws SQLException {
604     try {
605       rmiPrepStmt_.setNull(paramIndex,sqlType,typeName);
606     } catch(RemoteException JavaDoc e) {
607       throw new java.sql.SQLException JavaDoc(e.getMessage());
608     }
609   }
610
611   public void setDate(int parameterIndex, Date x,
612   java.util.Calendar JavaDoc cal) throws SQLException {
613     try {
614       rmiPrepStmt_.setDate(parameterIndex,x,cal);
615     } catch(RemoteException JavaDoc e) {
616       throw new java.sql.SQLException JavaDoc(e.getMessage());
617     }
618   }
619
620   public void setClob(int i, Clob x) throws SQLException {
621     try {
622       rmiPrepStmt_.setClob(i,x);
623     } catch(RemoteException JavaDoc e) {
624       throw new java.sql.SQLException JavaDoc(e.getMessage());
625     }
626   }
627
628   public void setCharacterStream(int parameterIndex, java.io.Reader JavaDoc reader,
629   int length) throws SQLException {
630     try {
631 // rmiPrepStmt_.setCharacterStream(parameterIndex,reader,length);
632

633       rmiPrepStmt_.setCharacterStream(parameterIndex,
634         RJSerializer.toCharArray(reader), length);
635
636     } catch(Exception JavaDoc e) {
637       throw new java.sql.SQLException JavaDoc(e.getMessage());
638     }
639   }
640
641   public void setBlob(int i, Blob x) throws SQLException {
642     try {
643       rmiPrepStmt_.setBlob(i,x);
644     } catch(RemoteException JavaDoc e) {
645       throw new java.sql.SQLException JavaDoc(e.getMessage());
646     }
647   }
648
649   public void setArray(int i, Array x) throws SQLException {
650     try {
651       rmiPrepStmt_.setArray(i,x);
652     } catch(RemoteException JavaDoc e) {
653       throw new java.sql.SQLException JavaDoc(e.getMessage());
654     }
655   }
656
657   public ResultSetMetaData getMetaData() throws SQLException {
658     try {
659       return new RJResultSetMetaData(rmiPrepStmt_.getMetaData());
660     } catch(RemoteException JavaDoc e) {
661       throw new java.sql.SQLException JavaDoc(e.getMessage());
662     }
663   }
664
665   public void addBatch() throws SQLException {
666     try {
667       rmiPrepStmt_.addBatch();
668     } catch(RemoteException JavaDoc e) {
669       throw new java.sql.SQLException JavaDoc(e.getMessage());
670     }
671   }
672
673   //------------------------- JDBC 3.0 -----------------------------------
674
public void setURL(int parameterIndex, java.net.URL JavaDoc x) throws SQLException {
675     try {
676       rmiPrepStmt_.setURL(parameterIndex, x);
677     } catch(RemoteException JavaDoc e) {
678       throw new java.sql.SQLException JavaDoc(e.getMessage());
679     }
680   }
681
682
683   public ParameterMetaData getParameterMetaData() throws SQLException {
684     try {
685       return new RJParameterMetaData(rmiPrepStmt_.getParameterMetaData());
686     } catch(RemoteException JavaDoc e) {
687       throw new java.sql.SQLException JavaDoc(e.getMessage());
688     }
689   }
690
691 };
692
693
Popular Tags