This content has been marked as final. Show 2 replies
Named parameters are a little more self documenting.
Also you don't have issues with parameters going out of sync when you add new where clause elements.
String sql = "Select name from table where testDate between :dateFrom and :dateTo"; pstmt.setDate("dateFrom", dateFrom); pstmt.setDate("dateTo", dateTo);