Originally posted by Jeanne Boyarsky:
Alternatively, use java.util.Calendar to get the beginning of the first month and the end of the last month. You can then pass these two dates to a prepared statement. This may run faster, especially if you have an index on the field.
this will let your application database independent.