db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bryan Pendleton <bpendleton.de...@gmail.com>
Subject Re: Problem updating a record
Date Tue, 03 Dec 2013 01:29:56 GMT
> // Update this record by adding predicted return and predicted class
> psUpdate = conn.prepareStatement("UPDATE USD_JPY SET
> Return_predicted=?,Class_predicted=?");
> statements.add(psUpdate);
>
> psUpdate.setDouble(1, return_current);
> psUpdate.setString(2, class_current);
>
> conn.commit();
>
> However, the record is NOT being updated as I am wishing it to be ?

For one thing, it seems like you should call executeUpdate() on
the prepared statement in order to execute it.

For another thing, since the UPDATE statement has no WHERE clause,
it's going to update every row in the table, not just a single one.

thanks,

bryan


Mime
View raw message