Skip to content

Commit 6e2fab0

Browse files
author
Dave Cramer
committed
added empty result set testing
1 parent 1ed4a92 commit 6e2fab0

File tree

1 file changed

+24
-1
lines changed

1 file changed

+24
-1
lines changed

src/interfaces/jdbc/org/postgresql/test/jdbc2/MiscTest.java

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import java.sql.*;
66

77
/*
8-
* $Id: MiscTest.java,v 1.5 2002/05/30 16:26:55 davec Exp $
8+
* $Id: MiscTest.java,v 1.6 2002/06/14 10:56:13 davec Exp $
99
*
1010
* Some simple tests based on problems reported by users. Hopefully these will
1111
* help prevent previous problems from re-occuring ;-)
@@ -52,6 +52,29 @@ public void testDatabaseSelectNullBug()
5252
}
5353
}
5454

55+
public void testError()
56+
{
57+
Connection con = JDBC2Tests.openDB();
58+
try
59+
{
60+
61+
// transaction mode
62+
con.setAutoCommit(false);
63+
Statement stmt = con.createStatement();
64+
stmt.execute("select 1/0");
65+
fail( "Should not execute this, as a SQLException s/b thrown" );
66+
con.commit();
67+
}
68+
catch ( Exception ex )
69+
{
70+
}
71+
try
72+
{
73+
con.commit();
74+
con.close();
75+
}catch ( Exception ex) {}
76+
}
77+
5578
public void xtestLocking()
5679
{
5780

0 commit comments

Comments
 (0)