1 package org.cacert.gigi.database;
4 import java.sql.PreparedStatement;
5 import java.sql.ResultSet;
6 import java.sql.SQLException;
7 import java.sql.Timestamp;
9 public class GigiPreparedStatement {
11 PreparedStatement target;
13 public GigiPreparedStatement(PreparedStatement preparedStatement) {
14 target = preparedStatement;
17 public GigiResultSet executeQuery() {
19 return new GigiResultSet(target.executeQuery());
20 } catch (SQLException e) {
26 public int executeUpdate() {
28 return target.executeUpdate();
29 } catch (SQLException e) {
35 public boolean execute() {
37 return target.execute();
38 } catch (SQLException e) {
44 public void setInt(int parameterIndex, int x) {
46 target.setInt(parameterIndex, x);
47 } catch (SQLException e) {
53 public void setString(int parameterIndex, String x) {
55 target.setString(parameterIndex, x);
56 } catch (SQLException e) {
62 public void setDate(int parameterIndex, Date x) {
64 target.setDate(parameterIndex, x);
65 } catch (SQLException e) {
71 public void setTimestamp(int parameterIndex, Timestamp x) {
73 target.setTimestamp(parameterIndex, x);
74 } catch (SQLException e) {
80 public int lastInsertId() {
82 ResultSet rs = target.getGeneratedKeys();
84 int id = rs.getInt(1);
87 } catch (SQLException e) {
93 public void setBoolean(int parameterIndex, boolean x) {
95 target.setBoolean(parameterIndex, x);
96 } catch (SQLException e) {
102 private void handleSQL(SQLException e) {
103 // TODO Auto-generated method stub