Index: org/postgresql/test/jdbc2/CallableStmtTest.java =================================================================== RCS file: /usr/local/cvsroot/pgjdbc/pgjdbc/org/postgresql/test/jdbc2/CallableStmtTest.java,v retrieving revision 1.18 diff -c -r1.18 CallableStmtTest.java *** org/postgresql/test/jdbc2/CallableStmtTest.java 14 Dec 2005 14:26:08 -0000 1.18 --- org/postgresql/test/jdbc2/CallableStmtTest.java 22 May 2006 10:04:42 -0000 *************** *** 175,180 **** --- 175,203 ---- assertEquals(1, call.getInt(1)); } + public void testFetchBeforeExecute() throws SQLException { + CallableStatement cs = con.prepareCall("{? = call lower(?)}"); + cs.registerOutParameter(1, Types.VARCHAR); + cs.setString(2, "Hi"); + try { + cs.getString(1); + fail("expected exception"); + } catch(Exception e) { + assertTrue(e instanceof SQLException); + } + } + + public void testFetchWithNoResults() throws SQLException { + CallableStatement cs = con.prepareCall("{call now()}"); + cs.execute(); + try { + cs.getObject(1); + fail("expected exception"); + } catch(Exception e) { + assertTrue(e instanceof SQLException); + } + } + public void testBadStmt () throws Throwable { tryOneBadStmt ("{ ?= " + pkgName + "getString (?) }");