diff options
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc1/Statement.java')
-rw-r--r-- | src/interfaces/jdbc/org/postgresql/jdbc1/Statement.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/Statement.java b/src/interfaces/jdbc/org/postgresql/jdbc1/Statement.java index 43e5d38143..fcc6dac360 100644 --- a/src/interfaces/jdbc/org/postgresql/jdbc1/Statement.java +++ b/src/interfaces/jdbc/org/postgresql/jdbc1/Statement.java @@ -13,7 +13,7 @@ import org.postgresql.util.PSQLException; * A Statement object is used for executing a static SQL statement and * obtaining the results produced by it. * - * <p>Only one ResultSet per Statement can be open at any point in time. + * <p>Only one ResultSet per Statement can be open at any point in time. * Therefore, if the reading of one ResultSet is interleaved with the * reading of another, each must have been generated by different * Statements. All statement execute methods implicitly close a @@ -29,7 +29,7 @@ public class Statement implements java.sql.Statement SQLWarning warnings = null; // The warnings chain. int timeout = 0; // The timeout for a query (not used) boolean escapeProcessing = true;// escape processing flag - + /** * Constructor for a Statement. It simply sets the connection * that created us. @@ -81,8 +81,8 @@ public class Statement implements java.sql.Statement * for this to happen when it is automatically closed. The * close method provides this immediate release. * - * <p><B>Note:</B> A Statement is automatically closed when it is - * garbage collected. When a Statement is closed, its current + * <p><B>Note:</B> A Statement is automatically closed when it is + * garbage collected. When a Statement is closed, its current * ResultSet, if one exists, is also closed. * * @exception SQLException if a database access error occurs (why?) @@ -146,7 +146,7 @@ public class Statement implements java.sql.Statement /** * If escape scanning is on (the default), the driver will do escape - * substitution before sending the SQL to the database. + * substitution before sending the SQL to the database. * * @param enable true to enable; false to disable * @exception SQLException if a database access error occurs @@ -183,7 +183,7 @@ public class Statement implements java.sql.Statement /** * Cancel can be used by one thread to cancel a statement that * is being executed by another thread. However, PostgreSQL is - * a sync. sort of thing, so this really has no meaning - we + * a sync. sort of thing, so this really has no meaning - we * define it as a no-op (i.e. you can't cancel, but there is no * error if you try.) * @@ -256,7 +256,7 @@ public class Statement implements java.sql.Statement /** * Execute a SQL statement that may return multiple results. We * don't have to worry about this since we do not support multiple - * ResultSets. You can use getResultSet or getUpdateCount to + * ResultSets. You can use getResultSet or getUpdateCount to * retrieve the result. * * @param sql any SQL statement @@ -266,8 +266,10 @@ public class Statement implements java.sql.Statement */ public boolean execute(String sql) throws SQLException { - result = connection.ExecSQL(sql); - return (result != null && ((org.postgresql.ResultSet)result).reallyResultSet()); + if(escapeProcessing) + sql=connection.EscapeSQL(sql); + result = connection.ExecSQL(sql); + return (result != null && ((org.postgresql.ResultSet)result).reallyResultSet()); } /** @@ -309,7 +311,7 @@ public class Statement implements java.sql.Statement result = ((org.postgresql.ResultSet)result).getNext(); return (result != null && ((org.postgresql.ResultSet)result).reallyResultSet()); } - + /** * Returns the status message from the current Result.<p> * This is used internally by the driver. |