summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
diff options
context:
space:
mode:
authorBarry Lind <barry@xythos.com>2002-09-11 05:38:45 +0000
committerBarry Lind <barry@xythos.com>2002-09-11 05:38:45 +0000
commitd634a5903f615a45cb463155c04d3df904e1b91a (patch)
treee25d0e3be7657f03bc32499debdade300bbbea8a /src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
parent8aa966e4b8d6133e214ecd57eaec76ac9888a2a6 (diff)
downloadpostgresql-d634a5903f615a45cb463155c04d3df904e1b91a.tar.gz
Patches submitted by Kris Jurka (jurka@ejurka.com) for the following bugs:
- Properly drop tables in jdbc regression tests with cascade for 7.3 - problem with Statement.execute() and executeUpdate() not clearing binds - problem with ResultSet not correctly handling default encoding - changes to correctly support show transaction isolation level in 7.3 - changed DatabaseMetaDataTest to handle differences in FK names in 7.3 - better fix for dynamically checking server NAME data length (With the fixes above the jdbc regression tests pass on jdbc2 and jdbc3 against both a 7.2 and 7.3 server) Patchs submitted by David Wall (d.wall@computer.org): - problem with getBlob when largeobject oid is null - improvements to BlobOutputStream Patch submitted by Haris Peco (snpe@snpe.co.yu): - problem with callable statement not supporting prepared statement methods Modified Files: jdbc/org/postgresql/Driver.java.in jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java jdbc/org/postgresql/jdbc1/AbstractJdbc1Statement.java jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java jdbc/org/postgresql/jdbc2/AbstractJdbc2Statement.java jdbc/org/postgresql/jdbc2/Jdbc2ResultSet.java jdbc/org/postgresql/jdbc3/Jdbc3ResultSet.java jdbc/org/postgresql/largeobject/BlobOutputStream.java jdbc/org/postgresql/largeobject/LargeObject.java jdbc/org/postgresql/test/TestUtil.java jdbc/org/postgresql/test/jdbc2/DatabaseMetaDataTest.java jdbc/org/postgresql/test/jdbc2/UpdateableResultTest.java jdbc/org/postgresql/test/jdbc2/optional/BaseDataSourceTest.java jdbc/org/postgresql/test/jdbc2/optional/ConnectionPoolTest.java jdbc/org/postgresql/test/jdbc2/optional/SimpleDataSourceTest.java
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java')
-rw-r--r--src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java35
1 files changed, 23 insertions, 12 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
index 45160ba34f..bf4ee76bd7 100644
--- a/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
+++ b/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1Connection.java
@@ -14,7 +14,7 @@ import org.postgresql.largeobject.LargeObjectManager;
import org.postgresql.util.*;
-/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.8 2002/09/06 21:23:05 momjian Exp $
+/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc1/Attic/AbstractJdbc1Connection.java,v 1.9 2002/09/11 05:38:44 barry Exp $
* This class defines methods of the jdbc1 specification. This class is
* extended by org.postgresql.jdbc2.AbstractJdbc2Connection which adds the jdbc2
* methods. The real Connection class (for jdbc1) is org.postgresql.jdbc1.Jdbc1Connection
@@ -982,21 +982,32 @@ public abstract class AbstractJdbc1Connection implements org.postgresql.PGConnec
*/
public int getTransactionIsolation() throws SQLException
{
- clearWarnings();
- ExecSQL("show transaction isolation level");
-
- SQLWarning warning = getWarnings();
- if (warning != null)
- {
- String message = warning.getMessage();
+ String sql = "show transaction isolation level";
+ String level = null;
+ if (haveMinimumServerVersion("7.3")) {
+ ResultSet rs = ExecSQL(sql);
+ if (rs.next()) {
+ level = rs.getString(1);
+ }
+ rs.close();
+ } else {
clearWarnings();
- if (message.indexOf("READ COMMITTED") != -1)
+ ExecSQL(sql);
+ SQLWarning warning = getWarnings();
+ if (warning != null)
+ {
+ level = warning.getMessage();
+ }
+ clearWarnings();
+ }
+ if (level != null) {
+ if (level.indexOf("READ COMMITTED") != -1)
return java.sql.Connection.TRANSACTION_READ_COMMITTED;
- else if (message.indexOf("READ UNCOMMITTED") != -1)
+ else if (level.indexOf("READ UNCOMMITTED") != -1)
return java.sql.Connection.TRANSACTION_READ_UNCOMMITTED;
- else if (message.indexOf("REPEATABLE READ") != -1)
+ else if (level.indexOf("REPEATABLE READ") != -1)
return java.sql.Connection.TRANSACTION_REPEATABLE_READ;
- else if (message.indexOf("SERIALIZABLE") != -1)
+ else if (level.indexOf("SERIALIZABLE") != -1)
return java.sql.Connection.TRANSACTION_SERIALIZABLE;
}
return java.sql.Connection.TRANSACTION_READ_COMMITTED;