Hi,

When using prepared statements in Java, I am unable to pass negative
integer values to the database:

String APPEND_JOURNAL = "INSERT INTO journal VALUES (?, ?);";
st = con.prepareStatement(APPEND_JOURNAL);
st.setInt(1, fromAcc);
st.setInt(2, -amount);
st.executeUpdate();

The table "journal" has two columns: account (int) and amount (bigint).

The insert statement executes without error, but inserts the positive
value (+amount, cf. line 4). The debugger, in contrast, says something
like "exec 3(200, -30)". Note that is has a minus in front of the
second parameter.

Without prepared statements, however, inserting negative values works
perfactly fine.

Thanks,
Jan

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Monetdb-bugs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-bugs

Reply via email to