diff options
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc2')
| -rw-r--r-- | src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java | 13 | ||||
| -rw-r--r-- | src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java | 23 |
2 files changed, 16 insertions, 20 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java b/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java index 3b493de2f4d..43e71062ab9 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java @@ -15,15 +15,13 @@ import org.postgresql.util.PGbytea; import org.postgresql.util.PSQLException; -/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.4 2002/08/14 20:35:39 barry Exp $ +/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.5 2002/08/23 20:45:49 barry Exp $ * This class defines methods of the jdbc2 specification. This class extends * org.postgresql.jdbc1.AbstractJdbc1ResultSet which provides the jdbc1 * methods. The real Statement class (for jdbc2) is org.postgresql.jdbc2.Jdbc2ResultSet */ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.AbstractJdbc1ResultSet { - protected String sqlQuery = null; - //needed for updateable result set support protected boolean updateable = false; protected boolean doingUpdates = false; @@ -1254,7 +1252,9 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra public void parseQuery() { - StringTokenizer st = new StringTokenizer(sqlQuery, " \r\t"); + String[] l_sqlFragments = ((AbstractJdbc2Statement)statement).getSqlFragments(); + String l_sql = l_sqlFragments[0]; + StringTokenizer st = new StringTokenizer(l_sql, " \r\t"); boolean tableFound = false, tablesChecked = false; String name = ""; @@ -1326,11 +1326,6 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra } - public void setSQLQuery(String sqlQuery) { - this.sqlQuery = sqlQuery; - } - - private class PrimaryKey { int index; // where in the result set is this primaryKey String name; // what is the columnName of this primary Key diff --git a/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java b/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java index d8d16985ad1..457f36e9413 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java @@ -8,7 +8,7 @@ import java.util.Vector; import org.postgresql.largeobject.*; import org.postgresql.util.PSQLException; -/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2Statement.java,v 1.3 2002/07/25 22:45:28 barry Exp $ +/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2Statement.java,v 1.4 2002/08/23 20:45:49 barry Exp $ * This class defines methods of the jdbc2 specification. This class extends * org.postgresql.jdbc1.AbstractJdbc1Statement which provides the jdbc1 * methods. The real Statement class (for jdbc2) is org.postgresql.jdbc2.Jdbc2Statement @@ -43,32 +43,28 @@ public abstract class AbstractJdbc2Statement extends org.postgresql.jdbc1.Abstra * an update count or there are no more results * @exception SQLException if a database access error occurs */ - public boolean execute(String sql) throws SQLException + public boolean execute() throws SQLException { - boolean l_return = super.execute(sql); + boolean l_return = super.execute(); //Now do the jdbc2 specific stuff //required for ResultSet.getStatement() to work and updateable resultsets ((AbstractJdbc2ResultSet)result).setStatement((Statement)this); - // Added this so that the Updateable resultset knows the query that gave this - ((AbstractJdbc2ResultSet)result).setSQLQuery(sql); - return l_return; } // ** JDBC 2 Extensions ** - public void addBatch(String sql) throws SQLException + public void addBatch(String p_sql) throws SQLException { if (batch == null) batch = new Vector(); - batch.addElement(sql); + batch.addElement(p_sql); } public void clearBatch() throws SQLException { - if (batch != null) - batch.removeAllElements(); + batch = null; } public int[] executeBatch() throws SQLException @@ -155,7 +151,7 @@ public abstract class AbstractJdbc2Statement extends org.postgresql.jdbc1.Abstra public void addBatch() throws SQLException { - addBatch(compileQuery()); + addBatch(this.toString()); } public java.sql.ResultSetMetaData getMetaData() throws SQLException @@ -388,4 +384,9 @@ public abstract class AbstractJdbc2Statement extends org.postgresql.jdbc1.Abstra } + //This is needed by AbstractJdbc2ResultSet to determine if the query is updateable or not + protected String[] getSqlFragments() { + return m_sqlFragments; + } + } |
