1. /*
  2. * Copyright 1999-2004 The Apache Software Foundation.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.apache.commons.dbcp;
  17. import java.sql.ResultSet;
  18. import java.math.BigDecimal;
  19. import java.sql.Date;
  20. import java.sql.Time;
  21. import java.sql.Timestamp;
  22. import java.io.InputStream;
  23. import java.sql.SQLWarning;
  24. import java.sql.ResultSetMetaData;
  25. import java.sql.SQLException;
  26. import java.io.Reader;
  27. import java.sql.Statement;
  28. import java.util.Map;
  29. import java.sql.Ref;
  30. import java.sql.Blob;
  31. import java.sql.Clob;
  32. import java.sql.Array;
  33. import java.util.Calendar;
  34. /**
  35. * A base delegating implementation of {@link ResultSet}.
  36. * <p>
  37. * All of the methods from the {@link ResultSet} interface
  38. * simply call the corresponding method on the "delegate"
  39. * provided in my constructor.
  40. * <p>
  41. * Extends AbandonedTrace to implement result set tracking and
  42. * logging of code which created the ResultSet. Tracking the
  43. * ResultSet ensures that the Statment which created it can
  44. * close any open ResultSet's on Statement close.
  45. *
  46. * @author Glenn L. Nielsen
  47. * @author James House
  48. * @author Dirk Verbeeck
  49. * @version $Revision: 1.13 $ $Date: 2004/03/06 13:35:31 $
  50. */
  51. public class DelegatingResultSet extends AbandonedTrace implements ResultSet {
  52. /** My delegate. **/
  53. private ResultSet _res;
  54. /** The Statement that created me, if any. **/
  55. private Statement _stmt;
  56. /**
  57. * Create a wrapper for the ResultSet which traces this
  58. * ResultSet to the Statement which created it and the
  59. * code which created it.
  60. *
  61. * @param Statement stmt which create this ResultSet
  62. * @param ResultSet to wrap
  63. */
  64. public DelegatingResultSet(Statement stmt, ResultSet res) {
  65. super((AbandonedTrace)stmt);
  66. this._stmt = stmt;
  67. this._res = res;
  68. }
  69. public static ResultSet wrapResultSet(Statement stmt, ResultSet rset) {
  70. if(null == rset) {
  71. return null;
  72. } else {
  73. return new DelegatingResultSet(stmt,rset);
  74. }
  75. }
  76. public ResultSet getDelegate() {
  77. return _res;
  78. }
  79. public boolean equals(Object obj) {
  80. ResultSet delegate = getInnermostDelegate();
  81. if (delegate == null) {
  82. return false;
  83. }
  84. if (obj instanceof DelegatingResultSet) {
  85. DelegatingResultSet s = (DelegatingResultSet) obj;
  86. return delegate.equals(s.getInnermostDelegate());
  87. }
  88. else {
  89. return delegate.equals(obj);
  90. }
  91. }
  92. public int hashCode() {
  93. Object obj = getInnermostDelegate();
  94. if (obj == null) {
  95. return 0;
  96. }
  97. return obj.hashCode();
  98. }
  99. /**
  100. * If my underlying {@link ResultSet} is not a
  101. * <tt>DelegatingResultSet</tt>, returns it,
  102. * otherwise recursively invokes this method on
  103. * my delegate.
  104. * <p>
  105. * Hence this method will return the first
  106. * delegate that is not a <tt>DelegatingResultSet</tt>,
  107. * or <tt>null</tt> when no non-<tt>DelegatingResultSet</tt>
  108. * delegate can be found by transversing this chain.
  109. * <p>
  110. * This method is useful when you may have nested
  111. * <tt>DelegatingResultSet</tt>s, and you want to make
  112. * sure to obtain a "genuine" {@link ResultSet}.
  113. */
  114. public ResultSet getInnermostDelegate() {
  115. ResultSet r = _res;
  116. while(r != null && r instanceof DelegatingResultSet) {
  117. r = ((DelegatingResultSet)r).getDelegate();
  118. if(this == r) {
  119. return null;
  120. }
  121. }
  122. return r;
  123. }
  124. public Statement getStatement() throws SQLException {
  125. return _stmt;
  126. }
  127. /**
  128. * Wrapper for close of ResultSet which removes this
  129. * result set from being traced then calls close on
  130. * the original ResultSet.
  131. */
  132. public void close() throws SQLException {
  133. try {
  134. if(_stmt != null) {
  135. ((AbandonedTrace)_stmt).removeTrace(this);
  136. _stmt = null;
  137. }
  138. _res.close();
  139. }
  140. catch (SQLException e) {
  141. handleException(e);
  142. }
  143. }
  144. protected void handleException(SQLException e) throws SQLException {
  145. if ((_stmt != null) && (_stmt instanceof DelegatingStatement)) {
  146. ((DelegatingStatement)_stmt).handleException(e);
  147. }
  148. else {
  149. throw e;
  150. }
  151. }
  152. public boolean next() throws SQLException
  153. { try { return _res.next(); } catch (SQLException e) { handleException(e); return false; } }
  154. public boolean wasNull() throws SQLException
  155. { try { return _res.wasNull(); } catch (SQLException e) { handleException(e); return false; } }
  156. public String getString(int columnIndex) throws SQLException
  157. { try { return _res.getString(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  158. public boolean getBoolean(int columnIndex) throws SQLException
  159. { try { return _res.getBoolean(columnIndex); } catch (SQLException e) { handleException(e); return false; } }
  160. public byte getByte(int columnIndex) throws SQLException
  161. { try { return _res.getByte(columnIndex); } catch (SQLException e) { handleException(e); return 0; } }
  162. public short getShort(int columnIndex) throws SQLException
  163. { try { return _res.getShort(columnIndex); } catch (SQLException e) { handleException(e); return 0; } }
  164. public int getInt(int columnIndex) throws SQLException
  165. { try { return _res.getInt(columnIndex); } catch (SQLException e) { handleException(e); return 0; } }
  166. public long getLong(int columnIndex) throws SQLException
  167. { try { return _res.getLong(columnIndex); } catch (SQLException e) { handleException(e); return 0; } }
  168. public float getFloat(int columnIndex) throws SQLException
  169. { try { return _res.getFloat(columnIndex); } catch (SQLException e) { handleException(e); return 0; } }
  170. public double getDouble(int columnIndex) throws SQLException
  171. { try { return _res.getDouble(columnIndex); } catch (SQLException e) { handleException(e); return 0; } }
  172. /** @deprecated */
  173. public BigDecimal getBigDecimal(int columnIndex, int scale) throws SQLException
  174. { try { return _res.getBigDecimal(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  175. public byte[] getBytes(int columnIndex) throws SQLException
  176. { try { return _res.getBytes(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  177. public Date getDate(int columnIndex) throws SQLException
  178. { try { return _res.getDate(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  179. public Time getTime(int columnIndex) throws SQLException
  180. { try { return _res.getTime(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  181. public Timestamp getTimestamp(int columnIndex) throws SQLException
  182. { try { return _res.getTimestamp(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  183. public InputStream getAsciiStream(int columnIndex) throws SQLException
  184. { try { return _res.getAsciiStream(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  185. /** @deprecated */
  186. public InputStream getUnicodeStream(int columnIndex) throws SQLException
  187. { try { return _res.getUnicodeStream(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  188. public InputStream getBinaryStream(int columnIndex) throws SQLException
  189. { try { return _res.getBinaryStream(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  190. public String getString(String columnName) throws SQLException
  191. { try { return _res.getString(columnName); } catch (SQLException e) { handleException(e); return null; } }
  192. public boolean getBoolean(String columnName) throws SQLException
  193. { try { return _res.getBoolean(columnName); } catch (SQLException e) { handleException(e); return false; } }
  194. public byte getByte(String columnName) throws SQLException
  195. { try { return _res.getByte(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  196. public short getShort(String columnName) throws SQLException
  197. { try { return _res.getShort(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  198. public int getInt(String columnName) throws SQLException
  199. { try { return _res.getInt(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  200. public long getLong(String columnName) throws SQLException
  201. { try { return _res.getLong(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  202. public float getFloat(String columnName) throws SQLException
  203. { try { return _res.getFloat(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  204. public double getDouble(String columnName) throws SQLException
  205. { try { return _res.getDouble(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  206. /** @deprecated */
  207. public BigDecimal getBigDecimal(String columnName, int scale) throws SQLException
  208. { try { return _res.getBigDecimal(columnName); } catch (SQLException e) { handleException(e); return null; } }
  209. public byte[] getBytes(String columnName) throws SQLException
  210. { try { return _res.getBytes(columnName); } catch (SQLException e) { handleException(e); return null; } }
  211. public Date getDate(String columnName) throws SQLException
  212. { try { return _res.getDate(columnName); } catch (SQLException e) { handleException(e); return null; } }
  213. public Time getTime(String columnName) throws SQLException
  214. { try { return _res.getTime(columnName); } catch (SQLException e) { handleException(e); return null; } }
  215. public Timestamp getTimestamp(String columnName) throws SQLException
  216. { try { return _res.getTimestamp(columnName); } catch (SQLException e) { handleException(e); return null; } }
  217. public InputStream getAsciiStream(String columnName) throws SQLException
  218. { try { return _res.getAsciiStream(columnName); } catch (SQLException e) { handleException(e); return null; } }
  219. /** @deprecated */
  220. public InputStream getUnicodeStream(String columnName) throws SQLException
  221. { try { return _res.getUnicodeStream(columnName); } catch (SQLException e) { handleException(e); return null; } }
  222. public InputStream getBinaryStream(String columnName) throws SQLException
  223. { try { return _res.getBinaryStream(columnName); } catch (SQLException e) { handleException(e); return null; } }
  224. public SQLWarning getWarnings() throws SQLException
  225. { try { return _res.getWarnings(); } catch (SQLException e) { handleException(e); return null; } }
  226. public void clearWarnings() throws SQLException
  227. { try { _res.clearWarnings(); } catch (SQLException e) { handleException(e); } }
  228. public String getCursorName() throws SQLException
  229. { try { return _res.getCursorName(); } catch (SQLException e) { handleException(e); return null; } }
  230. public ResultSetMetaData getMetaData() throws SQLException
  231. { try { return _res.getMetaData(); } catch (SQLException e) { handleException(e); return null; } }
  232. public Object getObject(int columnIndex) throws SQLException
  233. { try { return _res.getObject(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  234. public Object getObject(String columnName) throws SQLException
  235. { try { return _res.getObject(columnName); } catch (SQLException e) { handleException(e); return null; } }
  236. public int findColumn(String columnName) throws SQLException
  237. { try { return _res.findColumn(columnName); } catch (SQLException e) { handleException(e); return 0; } }
  238. public Reader getCharacterStream(int columnIndex) throws SQLException
  239. { try { return _res.getCharacterStream(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  240. public Reader getCharacterStream(String columnName) throws SQLException
  241. { try { return _res.getCharacterStream(columnName); } catch (SQLException e) { handleException(e); return null; } }
  242. public BigDecimal getBigDecimal(int columnIndex) throws SQLException
  243. { try { return _res.getBigDecimal(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  244. public BigDecimal getBigDecimal(String columnName) throws SQLException
  245. { try { return _res.getBigDecimal(columnName); } catch (SQLException e) { handleException(e); return null; } }
  246. public boolean isBeforeFirst() throws SQLException
  247. { try { return _res.isBeforeFirst(); } catch (SQLException e) { handleException(e); return false; } }
  248. public boolean isAfterLast() throws SQLException
  249. { try { return _res.isAfterLast(); } catch (SQLException e) { handleException(e); return false; } }
  250. public boolean isFirst() throws SQLException
  251. { try { return _res.isFirst(); } catch (SQLException e) { handleException(e); return false; } }
  252. public boolean isLast() throws SQLException
  253. { try { return _res.isLast(); } catch (SQLException e) { handleException(e); return false; } }
  254. public void beforeFirst() throws SQLException
  255. { try { _res.beforeFirst(); } catch (SQLException e) { handleException(e); } }
  256. public void afterLast() throws SQLException
  257. { try { _res.afterLast(); } catch (SQLException e) { handleException(e); } }
  258. public boolean first() throws SQLException
  259. { try { return _res.first(); } catch (SQLException e) { handleException(e); return false; } }
  260. public boolean last() throws SQLException
  261. { try { return _res.last(); } catch (SQLException e) { handleException(e); return false; } }
  262. public int getRow() throws SQLException
  263. { try { return _res.getRow(); } catch (SQLException e) { handleException(e); return 0; } }
  264. public boolean absolute(int row) throws SQLException
  265. { try { return _res.absolute(row); } catch (SQLException e) { handleException(e); return false; } }
  266. public boolean relative(int rows) throws SQLException
  267. { try { return _res.relative(rows); } catch (SQLException e) { handleException(e); return false; } }
  268. public boolean previous() throws SQLException
  269. { try { return _res.previous(); } catch (SQLException e) { handleException(e); return false; } }
  270. public void setFetchDirection(int direction) throws SQLException
  271. { try { _res.setFetchDirection(direction); } catch (SQLException e) { handleException(e); } }
  272. public int getFetchDirection() throws SQLException
  273. { try { return _res.getFetchDirection(); } catch (SQLException e) { handleException(e); return 0; } }
  274. public void setFetchSize(int rows) throws SQLException
  275. { try { _res.setFetchSize(rows); } catch (SQLException e) { handleException(e); } }
  276. public int getFetchSize() throws SQLException
  277. { try { return _res.getFetchSize(); } catch (SQLException e) { handleException(e); return 0; } }
  278. public int getType() throws SQLException
  279. { try { return _res.getType(); } catch (SQLException e) { handleException(e); return 0; } }
  280. public int getConcurrency() throws SQLException
  281. { try { return _res.getConcurrency(); } catch (SQLException e) { handleException(e); return 0; } }
  282. public boolean rowUpdated() throws SQLException
  283. { try { return _res.rowUpdated(); } catch (SQLException e) { handleException(e); return false; } }
  284. public boolean rowInserted() throws SQLException
  285. { try { return _res.rowInserted(); } catch (SQLException e) { handleException(e); return false; } }
  286. public boolean rowDeleted() throws SQLException
  287. { try { return _res.rowDeleted(); } catch (SQLException e) { handleException(e); return false; } }
  288. public void updateNull(int columnIndex) throws SQLException
  289. { try { _res.updateNull(columnIndex); } catch (SQLException e) { handleException(e); } }
  290. public void updateBoolean(int columnIndex, boolean x) throws SQLException
  291. { try { _res.updateBoolean(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  292. public void updateByte(int columnIndex, byte x) throws SQLException
  293. { try { _res.updateByte(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  294. public void updateShort(int columnIndex, short x) throws SQLException
  295. { try { _res.updateShort(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  296. public void updateInt(int columnIndex, int x) throws SQLException
  297. { try { _res.updateInt(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  298. public void updateLong(int columnIndex, long x) throws SQLException
  299. { try { _res.updateLong(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  300. public void updateFloat(int columnIndex, float x) throws SQLException
  301. { try { _res.updateFloat(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  302. public void updateDouble(int columnIndex, double x) throws SQLException
  303. { try { _res.updateDouble(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  304. public void updateBigDecimal(int columnIndex, BigDecimal x) throws SQLException
  305. { try { _res.updateBigDecimal(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  306. public void updateString(int columnIndex, String x) throws SQLException
  307. { try { _res.updateString(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  308. public void updateBytes(int columnIndex, byte[] x) throws SQLException
  309. { try { _res.updateBytes(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  310. public void updateDate(int columnIndex, Date x) throws SQLException
  311. { try { _res.updateDate(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  312. public void updateTime(int columnIndex, Time x) throws SQLException
  313. { try { _res.updateTime(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  314. public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException
  315. { try { _res.updateTimestamp(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  316. public void updateAsciiStream(int columnIndex, InputStream x, int length) throws SQLException
  317. { try { _res.updateAsciiStream(columnIndex, x, length); } catch (SQLException e) { handleException(e); } }
  318. public void updateBinaryStream(int columnIndex, InputStream x, int length) throws SQLException
  319. { try { _res.updateBinaryStream(columnIndex, x, length); } catch (SQLException e) { handleException(e); } }
  320. public void updateCharacterStream(int columnIndex, Reader x, int length) throws SQLException
  321. { try { _res.updateCharacterStream(columnIndex, x, length); } catch (SQLException e) { handleException(e); } }
  322. public void updateObject(int columnIndex, Object x, int scale) throws SQLException
  323. { try { _res.updateObject(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  324. public void updateObject(int columnIndex, Object x) throws SQLException
  325. { try { _res.updateObject(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  326. public void updateNull(String columnName) throws SQLException
  327. { try { _res.updateNull(columnName); } catch (SQLException e) { handleException(e); } }
  328. public void updateBoolean(String columnName, boolean x) throws SQLException
  329. { try { _res.updateBoolean(columnName, x); } catch (SQLException e) { handleException(e); } }
  330. public void updateByte(String columnName, byte x) throws SQLException
  331. { try { _res.updateByte(columnName, x); } catch (SQLException e) { handleException(e); } }
  332. public void updateShort(String columnName, short x) throws SQLException
  333. { try { _res.updateShort(columnName, x); } catch (SQLException e) { handleException(e); } }
  334. public void updateInt(String columnName, int x) throws SQLException
  335. { try { _res.updateInt(columnName, x); } catch (SQLException e) { handleException(e); } }
  336. public void updateLong(String columnName, long x) throws SQLException
  337. { try { _res.updateLong(columnName, x); } catch (SQLException e) { handleException(e); } }
  338. public void updateFloat(String columnName, float x) throws SQLException
  339. { try { _res.updateFloat(columnName, x); } catch (SQLException e) { handleException(e); } }
  340. public void updateDouble(String columnName, double x) throws SQLException
  341. { try { _res.updateDouble(columnName, x); } catch (SQLException e) { handleException(e); } }
  342. public void updateBigDecimal(String columnName, BigDecimal x) throws SQLException
  343. { try { _res.updateBigDecimal(columnName, x); } catch (SQLException e) { handleException(e); } }
  344. public void updateString(String columnName, String x) throws SQLException
  345. { try { _res.updateString(columnName, x); } catch (SQLException e) { handleException(e); } }
  346. public void updateBytes(String columnName, byte[] x) throws SQLException
  347. { try { _res.updateBytes(columnName, x); } catch (SQLException e) { handleException(e); } }
  348. public void updateDate(String columnName, Date x) throws SQLException
  349. { try { _res.updateDate(columnName, x); } catch (SQLException e) { handleException(e); } }
  350. public void updateTime(String columnName, Time x) throws SQLException
  351. { try { _res.updateTime(columnName, x); } catch (SQLException e) { handleException(e); } }
  352. public void updateTimestamp(String columnName, Timestamp x) throws SQLException
  353. { try { _res.updateTimestamp(columnName, x); } catch (SQLException e) { handleException(e); } }
  354. public void updateAsciiStream(String columnName, InputStream x, int length) throws SQLException
  355. { try { _res.updateAsciiStream(columnName, x, length); } catch (SQLException e) { handleException(e); } }
  356. public void updateBinaryStream(String columnName, InputStream x, int length) throws SQLException
  357. { try { _res.updateBinaryStream(columnName, x, length); } catch (SQLException e) { handleException(e); } }
  358. public void updateCharacterStream(String columnName, Reader reader, int length) throws SQLException
  359. { try { _res.updateCharacterStream(columnName, reader, length); } catch (SQLException e) { handleException(e); } }
  360. public void updateObject(String columnName, Object x, int scale) throws SQLException
  361. { try { _res.updateObject(columnName, x); } catch (SQLException e) { handleException(e); } }
  362. public void updateObject(String columnName, Object x) throws SQLException
  363. { try { _res.updateObject(columnName, x); } catch (SQLException e) { handleException(e); } }
  364. public void insertRow() throws SQLException
  365. { try { _res.insertRow(); } catch (SQLException e) { handleException(e); } }
  366. public void updateRow() throws SQLException
  367. { try { _res.updateRow(); } catch (SQLException e) { handleException(e); } }
  368. public void deleteRow() throws SQLException
  369. { try { _res.deleteRow(); } catch (SQLException e) { handleException(e); } }
  370. public void refreshRow() throws SQLException
  371. { try { _res.refreshRow(); } catch (SQLException e) { handleException(e); } }
  372. public void cancelRowUpdates() throws SQLException
  373. { try { _res.cancelRowUpdates(); } catch (SQLException e) { handleException(e); } }
  374. public void moveToInsertRow() throws SQLException
  375. { try { _res.moveToInsertRow(); } catch (SQLException e) { handleException(e); } }
  376. public void moveToCurrentRow() throws SQLException
  377. { try { _res.moveToCurrentRow(); } catch (SQLException e) { handleException(e); } }
  378. public Object getObject(int i, Map map) throws SQLException
  379. { try { return _res.getObject(i, map); } catch (SQLException e) { handleException(e); return null; } }
  380. public Ref getRef(int i) throws SQLException
  381. { try { return _res.getRef(i); } catch (SQLException e) { handleException(e); return null; } }
  382. public Blob getBlob(int i) throws SQLException
  383. { try { return _res.getBlob(i); } catch (SQLException e) { handleException(e); return null; } }
  384. public Clob getClob(int i) throws SQLException
  385. { try { return _res.getClob(i); } catch (SQLException e) { handleException(e); return null; } }
  386. public Array getArray(int i) throws SQLException
  387. { try { return _res.getArray(i); } catch (SQLException e) { handleException(e); return null; } }
  388. public Object getObject(String colName, Map map) throws SQLException
  389. { try { return _res.getObject(colName, map); } catch (SQLException e) { handleException(e); return null; } }
  390. public Ref getRef(String colName) throws SQLException
  391. { try { return _res.getRef(colName); } catch (SQLException e) { handleException(e); return null; } }
  392. public Blob getBlob(String colName) throws SQLException
  393. { try { return _res.getBlob(colName); } catch (SQLException e) { handleException(e); return null; } }
  394. public Clob getClob(String colName) throws SQLException
  395. { try { return _res.getClob(colName); } catch (SQLException e) { handleException(e); return null; } }
  396. public Array getArray(String colName) throws SQLException
  397. { try { return _res.getArray(colName); } catch (SQLException e) { handleException(e); return null; } }
  398. public Date getDate(int columnIndex, Calendar cal) throws SQLException
  399. { try { return _res.getDate(columnIndex, cal); } catch (SQLException e) { handleException(e); return null; } }
  400. public Date getDate(String columnName, Calendar cal) throws SQLException
  401. { try { return _res.getDate(columnName, cal); } catch (SQLException e) { handleException(e); return null; } }
  402. public Time getTime(int columnIndex, Calendar cal) throws SQLException
  403. { try { return _res.getTime(columnIndex, cal); } catch (SQLException e) { handleException(e); return null; } }
  404. public Time getTime(String columnName, Calendar cal) throws SQLException
  405. { try { return _res.getTime(columnName, cal); } catch (SQLException e) { handleException(e); return null; } }
  406. public Timestamp getTimestamp(int columnIndex, Calendar cal) throws SQLException
  407. { try { return _res.getTimestamp(columnIndex, cal); } catch (SQLException e) { handleException(e); return null; } }
  408. public Timestamp getTimestamp(String columnName, Calendar cal) throws SQLException
  409. { try { return _res.getTimestamp(columnName, cal); } catch (SQLException e) { handleException(e); return null; } }
  410. // ------------------- JDBC 3.0 -----------------------------------------
  411. // Will be commented by the build process on a JDBC 2.0 system
  412. /* JDBC_3_ANT_KEY_BEGIN */
  413. public java.net.URL getURL(int columnIndex) throws SQLException
  414. { try { return _res.getURL(columnIndex); } catch (SQLException e) { handleException(e); return null; } }
  415. public java.net.URL getURL(String columnName) throws SQLException
  416. { try { return _res.getURL(columnName); } catch (SQLException e) { handleException(e); return null; } }
  417. public void updateRef(int columnIndex, java.sql.Ref x) throws SQLException
  418. { try { _res.updateRef(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  419. public void updateRef(String columnName, java.sql.Ref x) throws SQLException
  420. { try { _res.updateRef(columnName, x); } catch (SQLException e) { handleException(e); } }
  421. public void updateBlob(int columnIndex, java.sql.Blob x) throws SQLException
  422. { try { _res.updateBlob(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  423. public void updateBlob(String columnName, java.sql.Blob x) throws SQLException
  424. { try { _res.updateBlob(columnName, x); } catch (SQLException e) { handleException(e); } }
  425. public void updateClob(int columnIndex, java.sql.Clob x) throws SQLException
  426. { try { _res.updateClob(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  427. public void updateClob(String columnName, java.sql.Clob x) throws SQLException
  428. { try { _res.updateClob(columnName, x); } catch (SQLException e) { handleException(e); } }
  429. public void updateArray(int columnIndex, java.sql.Array x) throws SQLException
  430. { try { _res.updateArray(columnIndex, x); } catch (SQLException e) { handleException(e); } }
  431. public void updateArray(String columnName, java.sql.Array x) throws SQLException
  432. { try { _res.updateArray(columnName, x); } catch (SQLException e) { handleException(e); } }
  433. /* JDBC_3_ANT_KEY_END */
  434. }