update a date on a MySQL table

From: alexjcasol (alexjcasol_at_tiscalinet.it)
Date: 07/21/04


Date: Wed, 21 Jul 2004 06:56:24 -0400

Hi all,
I'm trying to update a date field in a MySQL database, using the following
code:

Statement stmt =
connection.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,
ResultSet.CONCUR_UPDATABLE);
rs = stmt.executeQuery("select * from TabellaProva");
rs.moveToInsertRow();
rs.updateString("Field1", Value1);
rs.updateString("Field2", Value2);
rs.updateInt("Number", 101);
rs.updateDate("DataOrdine", (java.sql.Date)MyDate);
rs.insertRow();

where MyDate is a pure Date value.
If I omit the row with the updateDate statement everything works fine, but
if I include that row I recive a SQL error with no text.

Thank you
alexjcasol



Relevant Pages