diff options
| author | Barry Lind <barry@xythos.com> | 2003-08-24 22:10:09 +0000 |
|---|---|---|
| committer | Barry Lind <barry@xythos.com> | 2003-08-24 22:10:09 +0000 |
| commit | 2495365df10c2d6c2bf29988af7d875bb81a69b7 (patch) | |
| tree | b4fb09d1810779564d89b8d66918a9c85e6592be /src/interfaces/jdbc/org/postgresql/test | |
| parent | 478bb0268fa5b193a3269a4690b78bbf25cd0990 (diff) | |
Applied patches from Oliver Jowett to fix the following bugs:
- adds a finalizer method to AbstractJdbc1Statement to clean up in the case of
poor user code which fails to close the statement object
- fix ant build file to correctly detect dependencies across jdbc1/jdbc2/jdbc3
- fix a coupld of server prepared statement bugs and added regression test for
them
Applied patch from Kim Ho:
- adds support for get/setMaxFieldSize().
Also fixed build.xml to provide a better error message in the event that an
older version of the driver exists in the classpath when trying to build.
Diffstat (limited to 'src/interfaces/jdbc/org/postgresql/test')
| -rw-r--r-- | src/interfaces/jdbc/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/interfaces/jdbc/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java b/src/interfaces/jdbc/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java index dcd85572b7b..ea819b36333 100644 --- a/src/interfaces/jdbc/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java +++ b/src/interfaces/jdbc/org/postgresql/test/jdbc2/ServerPreparedStmtTest.java @@ -153,4 +153,26 @@ public class ServerPreparedStmtTest extends TestCase pstmt.close(); } + public void testSPSToggle() throws Exception + { + // Verify we can toggle UseServerPrepare safely before a query is executed. + PreparedStatement pstmt = con.prepareStatement("SELECT * FROM testsps WHERE id = 2"); + ((PGStatement)pstmt).setUseServerPrepare(true); + ((PGStatement)pstmt).setUseServerPrepare(false); + } + + public void testBytea() throws Exception + { + // Verify we can use setBytes() with a server-prepared update. + try { + TestUtil.createTable(con, "testsps_bytea", "data bytea"); + + PreparedStatement pstmt = con.prepareStatement("INSERT INTO testsps_bytea(data) VALUES (?)"); + ((PGStatement)pstmt).setUseServerPrepare(true); + pstmt.setBytes(1, new byte[100]); + pstmt.executeUpdate(); + } finally { + TestUtil.dropTable(con, "testsps_bytea"); + } + } } |
