I moved this to
Java in General because it really has nothing to do with
JDBC.
Check out the Joda Time library. It has a method like:
which you can use to get the amount of days between two dates. It also has a lot of other possibilities.
If you use Java 8, there is a new Date Time API in Java 8 which is likely to be able to help.