Subject Re: [Firebird-Java] Re: Select statement with Date
Author Luca Lafranchi
Hi Paul!

>
> I am using
>
> GregorianCalendar todayCal = new GregorianCalendar();
> java.sql.Date today = new java.sql.Date(todayCal.getTimeInMillis());
>
> "Select EmpName, EmpID from EMP where logoutdate='"+today+"';

Use PreparedStatements:

PreparedStatement pstmt = connection.prepareStatement(
"Select EmpName, EmpID from EMP where logoutdate=?");
pstmt.setDate(1,today);

ResultSet rs = pstmt.executeQuery();


This should work.

Ciao
Luca