changes to accomodate updateable resultset mostly just call setSqlQuery on execute
authorDave Cramer <[email protected]>
Thu, 13 Jun 2002 14:02:50 +0000 (14:02 +0000)
committerDave Cramer <[email protected]>
Thu, 13 Jun 2002 14:02:50 +0000 (14:02 +0000)
src/interfaces/jdbc/org/postgresql/jdbc2/Statement.java

index 2bbced64fd5b19a0102721cd0aca70e37bdbb130..a00025ff72ae77ab0617b40fc725b58d27fa9b6b 100644 (file)
@@ -71,6 +71,8 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
    public int executeUpdate(String sql) throws SQLException
    {
        this.execute(sql);
+       if (((org.postgresql.ResultSet)result).reallyResultSet())
+           throw new PSQLException("postgresql.stat.result");
        return this.getUpdateCount();
    }
 
@@ -124,12 +126,17 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
                rs.close();
        }
 
+
        // New in 7.1, pass Statement so that ExecSQL can customise to it
        result = connection.ExecSQL(sql, this);
 
        // New in 7.1, required for ResultSet.getStatement() to work
        ((org.postgresql.jdbc2.ResultSet)result).setStatement(this);
 
+       // Added this so that the Updateable resultset knows the query that gave this
+       ((org.postgresql.jdbc2.ResultSet)result).setSQLQuery(sql);
+
+
        return (result != null && ((org.postgresql.ResultSet)result).reallyResultSet());
    }
 
@@ -267,4 +274,108 @@ public class Statement extends org.postgresql.Statement implements java.sql.Stat
    {
        resultsettype = value;
    }
-}
+
+   // In JDK 1.4 not implemented
+  /**
+   *
+   * @param num
+   * @return
+   * @throws SQLException
+   */
+   public boolean getMoreResults(int num) throws SQLException
+  {
+       throw org.postgresql.Driver.notImplemented();
+   }
+
+  /**
+   *
+   * @return
+   * @throws SQLException
+   */
+   public java.sql.ResultSet getGeneratedKeys() throws SQLException
+  {
+       throw org.postgresql.Driver.notImplemented();
+   }
+
+  /**
+   *
+   * @param a
+   * @param b
+   * @return
+   * @throws SQLException
+   */
+   public int executeUpdate(String a, int b) throws SQLException
+  {
+       throw org.postgresql.Driver.notImplemented();
+   }
+
+  /**
+   *
+   * @param a
+   * @param b
+   * @return
+   * @throws SQLException
+   */
+   public int executeUpdate(String a, int[] b) throws SQLException
+  {
+       throw org.postgresql.Driver.notImplemented();
+
+   }
+
+   public int executeUpdate(String a, String[] b) throws SQLException
+  {
+       throw org.postgresql.Driver.notImplemented();
+
+   }
+
+  /**
+   *
+   * @param a
+   * @param b
+   * @return
+   * @throws SQLException
+   */
+   public boolean execute(String a, int b) throws SQLException
+  {
+       throw org.postgresql.Driver.notImplemented();
+
+   }
+
+  /**
+   *
+   * @param a
+   * @param b
+   * @return
+   * @throws SQLException
+   */
+   public boolean execute(String a, int[] b) throws SQLException
+  {
+       throw org.postgresql.Driver.notImplemented();
+
+   }
+
+  /**
+   *
+   * @param a
+   * @param b
+   * @return
+   * @throws SQLException
+   */
+   public boolean execute(String a, String[] b) throws SQLException
+  {
+       throw org.postgresql.Driver.notImplemented();
+
+   }
+
+  /**
+   *
+   * @return
+   * @throws SQLException
+   */
+   public int getResultSetHoldability() throws SQLException
+  {
+       throw org.postgresql.Driver.notImplemented();
+
+   }
+
+}
\ No newline at end of file