OSDN Git Service

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

index 2bbced6..a00025f 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