Subject Re: Another driver bug
Author vmdd_tech
Roman,

I am still using beta 3 or earlier. I am not sure of the version.
Even with this driver version, your test case works.

But, my test case is different from yours. I use Statement instead
of CallableStatement, and I KEEP USING the SAME Statement without
closing it. Here is your revised test case that failed:

public void testNPEInFieldIsNull() throws Exception {
Connection connection = getConnectionViaDriverManager();
Statement stmt = null;
try {
Statement stmt = connection.createStatement();
try {
stmt.execute (CALL_INIT_TEST_PROCEDURE);
} catch(SQLException ex) {
assertTrue("Should generate arithmetic exception.
Current code " +
ex.getErrorCode() + ", message " +
ex.getMessage(),
ex.getErrorCode() == 335544321);
} finally {
}

try {
ResultSet rs = stmt.executeQuery("SELECT * FROM
test");
while(rs.next())
rs.getObject(1);
} finally {
}

} finally {
connection.close();
}
}




Thanks,

Ben



--- In Firebird-Java@yahoogroups.com, "Roman Rokytskyy"
<rrokytskyy@a...> wrote:
> Hi,
>
> > Here are steps to reproduce it.
>
> Here's a test case for your steps. With it I could not reproduce the
> problem with CVS version of the driver. Can you please check what's
> wrong with it? Also please check your test case with latest version
of
> the driver (probably CVS one, but beta 3 should also be ok). I have
> added a check for null value and it should throw some exception with
> message "please report to the driver developer.".
>
> public void testNPEInFieldIsNull() throws Exception {
> Connection connection = getConnectionViaDriverManager();
> try {
> CallableStatement cs =
> connection.prepareCall(CALL_INIT_TEST_PROCEDURE);
> try {
> cs.execute();
> } catch(SQLException ex) {
> assertTrue("Should generate arithmetic exception.
> Current code " +
> ex.getErrorCode() + ", message " +
> ex.getMessage(),
> ex.getErrorCode() == 335544321);
> } finally {
> cs.close();
> }
>
> Statement stmt = connection.createStatement();
> try {
> ResultSet rs = stmt.executeQuery("SELECT * FROM
test");
> while(rs.next())
> rs.getObject(1);
> } finally {
> stmt.close();
> }
>
> } finally {
> connection.close();
> }
> }
>
>
> Thanks!
> Roman