PreparedStatementWrapper.java

00001 /*
00002  * JOnAS: Java(TM) Open Application Server
00003  * Copyright (C) 1999 Bull S.A.
00004  * Contact: jonas-team@objectweb.org
00005  *
00006  *
00007  * This library is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU Lesser General Public
00009  * License as published by the Free Software Foundation; either
00010  * version 2 of the License, or (at your option) any later version.
00011  *
00012  * This library is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015  * Lesser General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU Lesser General Public
00018  * License along with this library; if not, write to the Free Software
00019  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  * --------------------------------------------------------------------------
00022  * $Id: PreparedStatementWrapper.java,v 1.9 2004/11/17 20:54:07 ehardesty Exp $
00023  * --------------------------------------------------------------------------
00024  *
00025  */
00026 
00027 package org.objectweb.jonas.resource;
00028 
00029 import java.io.InputStream;
00030 import java.io.Reader;
00031 import java.math.BigDecimal;
00032 import java.net.URL;
00033 import java.sql.Array;
00034 import java.sql.Blob;
00035 import java.sql.Clob;
00036 import java.sql.Connection;
00037 import java.sql.Date;
00038 import java.sql.ParameterMetaData;
00039 import java.sql.PreparedStatement;
00040 import java.sql.Ref;
00041 import java.sql.ResultSet;
00042 import java.sql.ResultSetMetaData;
00043 import java.sql.SQLException;
00044 import java.sql.SQLWarning;
00045 import java.sql.Time;
00046 import java.sql.Timestamp;
00047 import java.util.Arrays;
00048 import java.util.Calendar;
00049 
00050 import org.objectweb.util.monolog.api.BasicLevel;
00051 import org.objectweb.util.monolog.api.Logger;
00052 
00058 public class PreparedStatementWrapper implements PreparedStatement {
00059 
00060     PreparedStatement pstmt = null;
00061 
00062     String user = null;
00063     String sql = null;
00064 
00065     boolean invalid = false;
00066     boolean closed = false;
00067 
00068     int hashCode;
00069 
00070     int resultSetType = -1;
00071     int resultSetConcurrency = -1;
00072 //  JDK1.4
00073     int resultSetHoldability = -1;
00074 
00075 //  JDK1.4
00076     int autoGeneratedKeys = -1;
00077     int [] columnIndexes = null;
00078     String [] columnNames = null;
00079 
00080     Logger trace = null;
00081 
00082     public PreparedStatementWrapper(String _user, String _sql,
00083                                      int _resultSetType,
00084                                      int _resultSetConcurrency,
00085                                      Logger _trace) {
00086 
00087         if (_user != null) {
00088             user = _user.trim();
00089         } else {
00090             user = null;
00091         }
00092         if (_sql != null) {
00093             sql = _sql.trim();
00094         } else {
00095             sql = null;
00096         }
00097         resultSetType = _resultSetType;
00098         resultSetConcurrency = _resultSetConcurrency;
00099         trace = _trace;
00100         String hashStr = user + sql + resultSetType + resultSetConcurrency;
00101         hashCode = hashStr.hashCode();
00102     }
00103 
00104 // JDK1.4
00105     public PreparedStatementWrapper(String _user, String _sql, 
00106                                      int _resultSetType,
00107                                      int _resultSetConcurrency,
00108                                      int _resultSetHoldability,
00109                                      Logger _trace) {
00110 
00111         user = _user;
00112         sql = _sql;
00113         resultSetType = _resultSetType;
00114         resultSetConcurrency = _resultSetConcurrency;
00115         resultSetHoldability = _resultSetHoldability;
00116         trace = _trace;
00117         String hashStr = user + sql + resultSetType + resultSetConcurrency + resultSetHoldability;
00118         hashCode = hashStr.hashCode();
00119     }
00120 
00121 
00122 // JDK1.4
00123     public PreparedStatementWrapper(String _user, String _sql,
00124                                      int _autoGeneratedKeys,
00125                                      Logger _trace) {
00126                                      
00127         user = _user;
00128         sql = _sql;
00129         autoGeneratedKeys = _autoGeneratedKeys;
00130         trace = _trace;
00131         String hashStr = user + sql + autoGeneratedKeys;
00132         hashCode = hashStr.hashCode();
00133     }
00134 
00135 //  JDK1.4
00136     public PreparedStatementWrapper(String _user, String _sql, 
00137                                      int [] _columnIndexes,
00138                                      Logger _trace) {
00139 
00140         user = _user;
00141         sql = _sql;
00142         columnIndexes = _columnIndexes;
00143         trace = _trace;
00144         String hashStr = user + sql + columnIndexes;
00145         hashCode = hashStr.hashCode();
00146     }
00147 
00148     //  JDK1.4
00149     public PreparedStatementWrapper(String _user, String _sql, 
00150                                      String [] _columnNames,
00151                                      Logger _trace) {
00152 
00153         user = _user;
00154         sql = _sql;
00155         columnNames = _columnNames;
00156         trace = _trace;
00157         String hashStr = user + sql + columnNames;
00158         hashCode = hashStr.hashCode();
00159     }
00160 
00161     public void checkIfValid() throws SQLException {
00162         if (invalid) {
00163             SQLException se = new SQLException("PreparedStatement(" + this + ") is invalid.");
00164             se.printStackTrace();
00165             throw se;
00166         }
00167 
00168     }
00169 
00170     public void clearPstmtValues() throws SQLException {
00171         closed = false;
00172         try {
00173             pstmt.clearParameters();
00174             pstmt.clearBatch();
00175         } catch (Throwable ex) { }
00176         try {
00177             pstmt.setEscapeProcessing(true);
00178         } catch (Throwable ex) { }
00179         try {
00180             pstmt.setFetchDirection(ResultSet.FETCH_FORWARD);
00181         } catch (Throwable ex) { }
00182         try {
00183             pstmt.setMaxFieldSize(0);
00184         } catch (Throwable ex) { }
00185         try {
00186             pstmt.setMaxRows(0);
00187         } catch (Throwable ex) { }
00188         try {
00189             pstmt.setQueryTimeout(0);
00190         } catch (Throwable ex) { }
00191         try {
00192             pstmt.clearWarnings();
00193         } catch (Throwable ex) { }
00194         }
00195 
00196     public void closePstmt() throws SQLException {
00197         closed = true;
00198         try {
00199             pstmt.close();
00200         } catch (SQLException e) {
00201             throw(e);
00202         }
00203     }
00204 
00205     public void destroy() throws SQLException {
00206         trace.log(BasicLevel.DEBUG, "" + this);
00207         try {
00208             pstmt.close();
00209         } catch (SQLException e) {
00210             throw(e);
00211         }
00212         invalid = true;
00213         closed = true;
00214     }
00215 
00216     public boolean equals(Object stmt) {
00217         trace.log(BasicLevel.DEBUG, "");
00218         if (stmt == null || !(stmt instanceof PreparedStatementWrapper)) {
00219             return false;
00220         }
00221         PreparedStatementWrapper psw = (PreparedStatementWrapper) stmt;
00222         if (invalid) {
00223             trace.log(BasicLevel.DEBUG, "Prepared Statement is invalid");
00224             return false;
00225         }
00226         if (hashCode != psw.hashCode) {
00227             trace.log(BasicLevel.DEBUG, "Hashcode of: " + psw.sql + " not equal to " + sql);
00228             return false;
00229         }
00230         if (sql == null && psw.sql != null) {
00231             trace.log(BasicLevel.DEBUG, "Stmt sql: " + psw.sql + " not equal to " + sql);
00232             return false;
00233         }
00234         if (sql != null && !sql.equals(psw.sql)) {
00235             trace.log(BasicLevel.DEBUG, "Stmt sql: " + psw.sql + " not equal to " + sql);
00236             return false;
00237         }
00238         if (user == null && psw.user != null) {
00239             trace.log(BasicLevel.DEBUG, "Stmt user: " + psw.user + " not equal to " + user);
00240             return false;
00241         }
00242         if (user != null && !user.equals(psw.user)) {
00243             trace.log(BasicLevel.DEBUG, "Stmt user: " + psw.user + " not equal to " + user);
00244             return false;
00245         }
00246         if (resultSetType != psw.resultSetType) {
00247             trace.log(BasicLevel.DEBUG, "Stmt resultSetType: " + psw.resultSetType + " not equal to "
00248                                         + resultSetType);
00249             return false;
00250         }
00251         if (resultSetConcurrency != psw.resultSetConcurrency) {
00252             trace.log(BasicLevel.DEBUG, "Stmt resultSetConcurrency: " + psw.resultSetConcurrency
00253                                         + " not equal to " + resultSetConcurrency);
00254             return false;
00255         }
00256         if (resultSetHoldability != psw.resultSetHoldability) {
00257             trace.log(BasicLevel.DEBUG, "Stmt resultSetHoldability: " + psw.resultSetHoldability
00258                                         + " not equal to " + resultSetHoldability);
00259             return false;
00260         }
00261         if (autoGeneratedKeys != psw.autoGeneratedKeys) {
00262             trace.log(BasicLevel.DEBUG, "Stmt autoGeneratedKeys: " + psw.autoGeneratedKeys
00263                                         + " not equal to " + autoGeneratedKeys);
00264             return false;
00265         }
00266         if (!Arrays.equals(columnIndexes, psw.columnIndexes)) {
00267             trace.log(BasicLevel.DEBUG, "Stmt columnIndexes: " + psw.columnIndexes + " not equal to "
00268                                         + columnIndexes);
00269             return false;
00270         }
00271         if (!Arrays.equals(columnNames, psw.columnNames)) {
00272             trace.log(BasicLevel.DEBUG, "Stmt columnNames: " + psw.columnNames + " not equal to "
00273                                         + columnNames);
00274             return false;
00275         }
00276         trace.log(BasicLevel.DEBUG, "Stmt found at " + this);
00277         return true;
00278     }
00279 
00280     public void setClosed(boolean val) {
00281         closed = val;
00282     }
00283 
00284     public void setPreparedStatement(PreparedStatement _pstmt) {
00285         pstmt = _pstmt;
00286     }
00287 
00288 /* *********************
00289    Prepared Statment calls
00290 */
00291 
00292 
00301     public void addBatch() throws SQLException {
00302         checkIfValid();
00303         try {
00304             pstmt.addBatch();
00305         } catch (SQLException e) {
00306             throw(e);
00307         }
00308     }
00309 
00320     public void clearParameters() throws SQLException {
00321         checkIfValid();
00322         try {
00323             pstmt.clearParameters();
00324         } catch (SQLException e) {
00325             throw(e);
00326         }
00327     }
00328 
00354     public boolean execute() throws SQLException {
00355         checkIfValid();
00356         try {
00357             return pstmt.execute();
00358         } catch (SQLException e) {
00359             throw(e);
00360         }
00361     }
00362 
00363 //  JDK1.4
00403     public boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
00404         checkIfValid();
00405         try {
00406             return pstmt.execute(sql, autoGeneratedKeys);
00407         } catch (SQLException e) {
00408             throw(e);
00409         }
00410     }
00411 
00412 //  JDK1.4
00450     public boolean execute(String sql, int [] columnIndexes) throws SQLException {
00451         checkIfValid();
00452         try {
00453             return pstmt.execute(sql, columnIndexes);
00454         } catch (SQLException e) {
00455             throw(e);
00456         }
00457     }
00458 
00459 //  JDK1.4
00498     public boolean execute(String sql, String [] columnNames) throws SQLException {
00499         checkIfValid();
00500         try {
00501             return pstmt.execute(sql, columnNames);
00502         } catch (SQLException e) {
00503             throw(e);
00504         }
00505     }
00506 
00516     public ResultSet executeQuery() throws SQLException {
00517         checkIfValid();
00518         try {
00519             return pstmt.executeQuery();
00520         } catch (SQLException e) {
00521             throw(e);
00522         }
00523     }
00524 
00537     public int executeUpdate() throws SQLException {
00538     checkIfValid();
00539         try {
00540             return pstmt.executeUpdate();
00541         } catch (SQLException e) {
00542             throw(e);
00543         }
00544     }
00545 
00546 //  JDK1.4
00569     public int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
00570         checkIfValid();
00571         try {
00572             return pstmt.executeUpdate(sql, autoGeneratedKeys);
00573         } catch (SQLException e) {
00574             throw(e);
00575         }
00576     }
00577 
00578 //  JDK1.4
00599     public int executeUpdate(String sql, int[] columnIndexes) throws SQLException {
00600         checkIfValid();
00601         try {
00602             return pstmt.executeUpdate(sql, columnIndexes);
00603         } catch (SQLException e) {
00604             throw(e);
00605         }
00606     }
00607 
00608 //  JDK1.4
00629     public int executeUpdate(String sql, String[] columnNames) throws SQLException {
00630         checkIfValid();
00631         try {
00632             return pstmt.executeUpdate(sql, columnNames);
00633         } catch (SQLException e) {
00634             throw(e);
00635         }
00636     }
00637 
00638 //  JDK1.4
00650     public ResultSet getGeneratedKeys() throws SQLException {
00651         checkIfValid();
00652         try {
00653             return pstmt.getGeneratedKeys();
00654         } catch (SQLException e) {
00655             throw(e);
00656         }
00657     }
00658 
00682     public ResultSetMetaData getMetaData() throws SQLException {
00683         checkIfValid();
00684         try {
00685             return pstmt.getMetaData();
00686         } catch (SQLException e) {
00687             throw(e);
00688         }
00689     }
00690 
00691 //  JDK1.4
00722     public boolean getMoreResults(int current) throws SQLException {
00723         checkIfValid();
00724         try {
00725             return pstmt.getMoreResults(current);
00726         } catch (SQLException e) {
00727             throw(e);
00728         }
00729     }
00730 
00731 //  JDK1.4
00743     public ParameterMetaData getParameterMetaData() throws SQLException {
00744         checkIfValid();
00745         try {
00746             return pstmt.getParameterMetaData();
00747         } catch (SQLException e) {
00748             throw(e);
00749         }
00750     }
00751 
00752 //  JDK1.4
00763     public int getResultSetHoldability() throws SQLException {
00764         checkIfValid();
00765         try {
00766             return pstmt.getResultSetHoldability();
00767         } catch (SQLException e) {
00768             throw(e);
00769         }
00770     }
00771 
00782     public void setArray(int i, Array x) throws SQLException {
00783         checkIfValid();
00784         try {
00785             pstmt.setArray(i, x);
00786         } catch (SQLException e) {
00787             throw(e);
00788         }
00789     }
00790 
00809     public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
00810         checkIfValid();
00811         try {
00812             pstmt.setAsciiStream(parameterIndex, x, length);
00813         } catch (SQLException e) {
00814             throw(e);
00815         }
00816     }
00817 
00827     public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
00828         checkIfValid();
00829         try {
00830             pstmt.setBigDecimal(parameterIndex, x);
00831         } catch (SQLException e) {
00832             throw(e);
00833         }
00834     }
00835 
00853     public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
00854         checkIfValid();
00855         try {
00856             pstmt.setBinaryStream(parameterIndex, x, length);
00857         } catch (SQLException e) {
00858             throw(e);
00859         }
00860     }
00861 
00872     public void setBlob(int i, Blob x) throws SQLException {
00873         checkIfValid();
00874         try {
00875             pstmt.setBlob(i, x);
00876         } catch (SQLException e) {
00877             throw(e);
00878         }
00879     }
00880 
00890     public void setBoolean(int parameterIndex, boolean x) throws SQLException {
00891         checkIfValid();
00892         try {
00893             pstmt.setBoolean(parameterIndex, x);
00894         } catch (SQLException e) {
00895             throw(e);
00896         }
00897     }
00898 
00908     public void setByte(int parameterIndex, byte x) throws SQLException {
00909         checkIfValid();
00910         try {
00911             pstmt.setByte(parameterIndex, x);
00912         } catch (SQLException e) {
00913             throw(e);
00914         }
00915     }
00916 
00927     public void setBytes(int parameterIndex, byte [] x) throws SQLException {
00928         checkIfValid();
00929         try {
00930             pstmt.setBytes(parameterIndex, x);
00931         } catch (SQLException e) {
00932             throw(e);
00933         }
00934     }
00935 
00956     public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
00957         checkIfValid();
00958         try {
00959             pstmt.setCharacterStream(parameterIndex, reader, length);
00960         } catch (SQLException e) {
00961             throw(e);
00962         }
00963     }
00964 
00975     public void setClob(int i, Clob x) throws SQLException {
00976         checkIfValid();
00977         try {
00978             pstmt.setClob(i, x);
00979         } catch (SQLException e) {
00980             throw(e);
00981         }
00982     }
00983 
00993     public void setDate(int parameterIndex, Date x) throws SQLException {
00994         checkIfValid();
00995         try {
00996             pstmt.setDate(parameterIndex, x);
00997         } catch (SQLException e) {
00998             throw(e);
00999         }
01000     }
01001 
01019     public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
01020         checkIfValid();
01021         try {
01022             pstmt.setDate(parameterIndex, x, cal);
01023         } catch (SQLException e) {
01024             throw(e);
01025         }
01026     }
01027 
01037     public void setDouble(int parameterIndex, double x) throws SQLException {
01038         checkIfValid();
01039         try {
01040             pstmt.setDouble(parameterIndex, x);
01041         } catch (SQLException e) {
01042             throw(e);
01043         }
01044     }
01045 
01055     public void setFloat(int parameterIndex, float x) throws SQLException {
01056         checkIfValid();
01057         try {
01058             pstmt.setFloat(parameterIndex, x);
01059         } catch (SQLException e) {
01060             throw(e);
01061         }
01062     }
01063 
01073     public void setInt(int parameterIndex, int x) throws SQLException {
01074         checkIfValid();
01075         try {
01076             pstmt.setInt(parameterIndex, x);
01077         } catch (SQLException e) {
01078             throw(e);
01079         }
01080     }
01081 
01091     public void setLong(int parameterIndex, long x) throws SQLException {
01092         checkIfValid();
01093         try {
01094             pstmt.setLong(parameterIndex, x);
01095         } catch (SQLException e) {
01096             throw(e);
01097         }
01098     }
01099 
01109     public void setNull(int parameterIndex, int sqlType) throws SQLException {
01110         checkIfValid();
01111         try {
01112             pstmt.setNull(parameterIndex, sqlType);
01113         } catch (SQLException e) {
01114             throw(e);
01115         }
01116     }
01117 
01146     public void setNull(int paramIndex, int sqlType, String typeName) throws SQLException {
01147         checkIfValid();
01148         try {
01149             pstmt.setNull(paramIndex, sqlType, typeName);
01150         } catch (SQLException e) {
01151             throw(e);
01152         }
01153     }
01154 
01185     public void setObject(int parameterIndex, Object x) throws SQLException {
01186         checkIfValid();
01187         try {
01188             pstmt.setObject(parameterIndex, x);
01189         } catch (SQLException e) {
01190             throw(e);
01191         }
01192     }
01193 
01205     public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
01206         checkIfValid();
01207         try {
01208             pstmt.setObject(parameterIndex, x, targetSqlType);
01209         } catch (SQLException e) {
01210             throw(e);
01211         }
01212     }
01213 
01244     public void setObject(int parameterIndex, Object x, int targetSqlType, int scale) throws SQLException {
01245         checkIfValid();
01246         try {
01247             pstmt.setObject(parameterIndex, x, targetSqlType, scale);
01248         } catch (SQLException e) {
01249             throw(e);
01250         }
01251     }
01252 
01264     public void setRef(int i, Ref x) throws SQLException {
01265         checkIfValid();
01266         try {
01267             pstmt.setRef(i, x);
01268         } catch (SQLException e) {
01269             throw(e);
01270         }
01271     }
01272 
01282     public void setShort(int parameterIndex, short x) throws SQLException {
01283         checkIfValid();
01284         try {
01285             pstmt.setShort(parameterIndex, x);
01286         } catch (SQLException e) {
01287             throw(e);
01288         }
01289     }
01290 
01303     public void setString(int parameterIndex, String x) throws SQLException {
01304         checkIfValid();
01305         try {
01306             pstmt.setString(parameterIndex, x);
01307         } catch (SQLException e) {
01308             throw(e);
01309         }
01310     }
01311 
01321     public void setTime(int parameterIndex, Time x) throws SQLException {
01322         checkIfValid();
01323         try {
01324             pstmt.setTime(parameterIndex, x);
01325         } catch (SQLException e) {
01326             throw(e);
01327         }
01328     }
01329 
01347     public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException  {
01348         checkIfValid();
01349         try {
01350             pstmt.setTime(parameterIndex, x, cal);
01351         } catch (SQLException e) {
01352             throw(e);
01353         }
01354     }
01355 
01366     public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
01367         checkIfValid();
01368         try {
01369             pstmt.setTimestamp(parameterIndex, x);
01370         } catch (SQLException e) {
01371             throw(e);
01372         }
01373     }
01374 
01392     public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
01393         checkIfValid();
01394         try {
01395             pstmt.setTimestamp(parameterIndex, x, cal);
01396         } catch (SQLException e) {
01397             throw(e);
01398         }
01399     }
01400 
01424     public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException {
01425         checkIfValid();
01426         try {
01427             pstmt.setUnicodeStream(parameterIndex, x, length);
01428         } catch (SQLException e) {
01429             throw(e);
01430         }
01431     }
01432 
01433 
01434     // Statement interface
01435 
01450     public void addBatch(String s) throws SQLException {
01451         checkIfValid();
01452         try {
01453             pstmt.addBatch(s);
01454         } catch (SQLException e) {
01455             throw(e);
01456         }
01457     }
01458 
01467     public void cancel() throws SQLException {
01468         checkIfValid();
01469         try {
01470             pstmt.cancel();
01471         } catch (SQLException e) {
01472             throw(e);
01473         }
01474     }
01475 
01487     public void clearBatch() throws SQLException {
01488         checkIfValid();
01489         try {
01490             pstmt.clearBatch();
01491         } catch (SQLException e) {
01492             throw(e);
01493         }
01494     }
01495 
01505     public void clearWarnings() throws SQLException {
01506         checkIfValid();
01507         try {
01508             pstmt.clearWarnings();
01509         } catch (SQLException e) {
01510             throw(e);
01511         }
01512     }
01513 
01532     public void close() throws SQLException {
01533         trace.log(BasicLevel.DEBUG, "" + this);
01534         closed = true;
01535 /*        try {
01536             pstmt.close();
01537         } catch (SQLException e) {
01538             throw(e);
01539         }
01540         //clearPstmtValues();
01541 */
01542     }
01543 
01567     public boolean execute(String s) throws SQLException {
01568         checkIfValid();
01569         try {
01570             return pstmt.execute(s);
01571         } catch (SQLException e) {
01572             throw(e);
01573         }
01574     }
01575 
01624     public int[] executeBatch() throws SQLException {
01625         checkIfValid();
01626         try {
01627             return pstmt.executeBatch();
01628         } catch (SQLException e) {
01629             throw(e);
01630         }
01631     }
01632 
01645     public ResultSet executeQuery(String s) throws SQLException {
01646         checkIfValid();
01647         try {
01648             return pstmt.executeQuery(s);
01649         } catch (SQLException e) {
01650             throw(e);
01651         }
01652     }
01653 
01667     public int executeUpdate(String s) throws SQLException {
01668         checkIfValid();
01669         try {
01670             return pstmt.executeUpdate(s);
01671         } catch (SQLException e) {
01672             throw(e);
01673         }
01674     }
01675 
01683     public Connection getConnection() throws SQLException {
01684         checkIfValid();
01685         try {
01686             return pstmt.getConnection();
01687         } catch (SQLException e) {
01688             throw(e);
01689         }
01690     }
01691 
01706     public int getFetchDirection() throws SQLException {
01707         checkIfValid();
01708         try {
01709             return pstmt.getFetchDirection();
01710         } catch (SQLException e) {
01711             throw(e);
01712         }
01713     }
01714 
01729     public int getFetchSize() throws SQLException {
01730         checkIfValid();
01731         try {
01732             return pstmt.getFetchSize();
01733         } catch (SQLException e) {
01734             throw(e);
01735         }
01736     }
01737 
01753     public int getMaxFieldSize() throws SQLException {
01754         checkIfValid();
01755         try {
01756             return pstmt.getMaxFieldSize();
01757         } catch (SQLException e) {
01758             throw(e);
01759         }
01760     }
01761 
01774     public int getMaxRows() throws SQLException {
01775         checkIfValid();
01776         try {
01777             return pstmt.getMaxRows();
01778         } catch (SQLException e) {
01779             throw(e);
01780         }
01781     }
01782 
01801     public boolean getMoreResults() throws SQLException {
01802         checkIfValid();
01803         try {
01804             return pstmt.getMoreResults();
01805         } catch (SQLException e) {
01806             throw(e);
01807         }
01808     }
01809 
01820     public int getQueryTimeout() throws SQLException {
01821         checkIfValid();
01822         try {
01823             return pstmt.getQueryTimeout();
01824         } catch (SQLException e) {
01825             throw(e);
01826         }
01827     }
01828 
01838     public ResultSet getResultSet() throws SQLException {
01839         checkIfValid();
01840         try {
01841             return pstmt.getResultSet();
01842         } catch (SQLException e) {
01843             throw(e);
01844         }
01845     }
01846 
01856     public int getResultSetConcurrency() throws SQLException {
01857         checkIfValid();
01858         try {
01859             return pstmt.getResultSetConcurrency();
01860         } catch (SQLException e) {
01861             throw(e);
01862         }
01863     }
01864 
01875     public int getResultSetType() throws SQLException {
01876         checkIfValid();
01877         try {
01878             return pstmt.getResultSetType();
01879         } catch (SQLException e) {
01880             throw(e);
01881         }
01882     }
01883 
01894     public int getUpdateCount() throws SQLException {
01895         checkIfValid();
01896         try {
01897             return pstmt.getUpdateCount();
01898         } catch (SQLException e) {
01899             throw(e);
01900         }
01901     }
01902 
01923     public SQLWarning getWarnings() throws SQLException {
01924         checkIfValid();
01925         try {
01926             return pstmt.getWarnings();
01927         } catch (SQLException e) {
01928             throw(e);
01929         }
01930     }
01931 
01953     public void setCursorName(String name) throws SQLException {
01954         checkIfValid();
01955         try {
01956             pstmt.setCursorName(name);
01957         } catch (SQLException e) {
01958             throw(e);
01959         }
01960     }
01961 
01975     public void setEscapeProcessing(boolean enable) throws SQLException {
01976         checkIfValid();
01977         try {
01978             pstmt.setEscapeProcessing(enable);
01979         } catch (SQLException e) {
01980             throw(e);
01981         }
01982     }
01983 
02003     public void setFetchDirection(int direction) throws SQLException {
02004         checkIfValid();
02005         try {
02006             pstmt.setFetchDirection(direction);
02007         } catch (SQLException e) {
02008             throw(e);
02009         }
02010     }
02011 
02026     public void setFetchSize(int rows) throws SQLException {
02027         checkIfValid();
02028         try {
02029             pstmt.setFetchSize(rows);
02030         } catch (SQLException e) {
02031             throw(e);
02032         }
02033     }
02034 
02050     public void setMaxFieldSize(int max) throws SQLException {
02051         checkIfValid();
02052         try {
02053             pstmt.setMaxFieldSize(max);
02054         } catch (SQLException e) {
02055             throw(e);
02056         }
02057     }
02058 
02070     public void setMaxRows(int max) throws SQLException {
02071         checkIfValid();
02072         try {
02073             pstmt.setMaxRows(max);
02074         } catch (SQLException e) {
02075             throw(e);
02076         }
02077     }
02078 
02090     public void setQueryTimeout(int seconds) throws SQLException {
02091         checkIfValid();
02092         try {
02093             pstmt.setQueryTimeout(seconds);
02094         } catch (SQLException e) {
02095             throw(e);
02096         }
02097     }
02098 
02099 //  JDK1.4
02110     public void setURL(int parameterIndex, URL x) throws SQLException {
02111         checkIfValid();
02112         try {
02113             pstmt.setURL(parameterIndex, x);
02114         } catch (SQLException e) {
02115             throw(e);
02116         }
02117     }
02118 
02119 }

Generated on Tue Feb 15 15:05:20 2005 for JOnAS by  doxygen 1.3.9.1