A
Alessandro
Thinking about making dynalic a JDBC update according to number of fields to
be updated. In my case we have an update to be executed cyclically and at
every cycle I receive values to be updated from another source and they can
be different each time.
This is the classical base for update:
PreparedStatement ps = conn.prepareStatement("UPDATE Messages SET
description = ?, author = ? WHERE id = ? AND seq_num = ?");
ps.setString(1,description);
ps.setString(2,author);
ps.setInt(3,id);
ps.setInt(4,seqNum);
Any idea ? Hibernate simplifies a lot but it needs - look at precedent
post - a preliminary select for each update.Thanks and best
regards,Alessandro
be updated. In my case we have an update to be executed cyclically and at
every cycle I receive values to be updated from another source and they can
be different each time.
This is the classical base for update:
PreparedStatement ps = conn.prepareStatement("UPDATE Messages SET
description = ?, author = ? WHERE id = ? AND seq_num = ?");
ps.setString(1,description);
ps.setString(2,author);
ps.setInt(3,id);
ps.setInt(4,seqNum);
Any idea ? Hibernate simplifies a lot but it needs - look at precedent
post - a preliminary select for each update.Thanks and best
regards,Alessandro