From: Dave Cramer Date: Fri, 14 Jun 2002 10:56:13 +0000 (+0000) Subject: added empty result set testing X-Git-Tag: REL7_3~1386 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6e2fab0a411d9d4811096b34008a712cef7c92b0;p=postgresql added empty result set testing --- diff --git a/src/interfaces/jdbc/org/postgresql/test/jdbc2/MiscTest.java b/src/interfaces/jdbc/org/postgresql/test/jdbc2/MiscTest.java index 8a13ddf3ee..753d33a3e6 100644 --- a/src/interfaces/jdbc/org/postgresql/test/jdbc2/MiscTest.java +++ b/src/interfaces/jdbc/org/postgresql/test/jdbc2/MiscTest.java @@ -5,7 +5,7 @@ import junit.framework.TestCase; import java.sql.*; /* - * $Id: MiscTest.java,v 1.5 2002/05/30 16:26:55 davec Exp $ + * $Id: MiscTest.java,v 1.6 2002/06/14 10:56:13 davec Exp $ * * Some simple tests based on problems reported by users. Hopefully these will * help prevent previous problems from re-occuring ;-) @@ -52,6 +52,29 @@ public class MiscTest extends TestCase } } + public void testError() + { + Connection con = JDBC2Tests.openDB(); + try + { + + // transaction mode + con.setAutoCommit(false); + Statement stmt = con.createStatement(); + stmt.execute("select 1/0"); + fail( "Should not execute this, as a SQLException s/b thrown" ); + con.commit(); + } + catch ( Exception ex ) + { + } + try + { + con.commit(); + con.close(); + }catch ( Exception ex) {} + } + public void xtestLocking() {