Java - Date variables and SQL ResultSet - TechRepublic
General discussion
November 11, 2002 at 11:08 PM
mk1

Java – Date variables and SQL ResultSet

by mk1 . Updated 23 years, 7 months ago

I am running an SQL query in my Java program which returns a date variable as part of the resultset. I then try to assign this value to another Date variable and use in a subsequent query but receive error messages in relation to syntax
Some samplecode:
java.util.Date d1 = rs3.getDate(1);

ResultSet rs1 = myDB2.Select2(“select * from worksheet where worksheet.work_date = ” + d1 + ” order by worksheet.work_date”);

If anybody has any suggestions I would be most grateful for any assistance

This discussion is locked

All Comments