Subject Re: PreparedStatements
Author Roman Rokytskyy
> ps.setDate(4, parseDate(val));
> where parseDate returns a java.sql.Date with the hours, minutes,
> seconds and milliseconds set to 0.
> I am assuming that with a PS of 'insert into table (f1, f2, f4, f3)
> values (?, ?, ?, ?)' that the types are read in the order specified by
> the SQL and not the order in which they are specified on the table.

Correct, it uses order from the statement.

> So fields 1, 2 and 4 are varchars, field 3 is a date on the table
> defintion. So PS.setDate(4, date) is still correct in theory.

Yes. Can you please provide a test case - Java class that creates
appropriate table, populates it, and reproduces an error?