I have a problem when getting a Date object from a ResultSet. In database it has a value (for example 2014-08-01) and after getting it from resultSet, it has another value (2014-08-31). I know that ResultSet's getDate method returns java.sql.Date, but I tried a few solutions, such as:
Date date=new java.util.Date(resultSet.getDate(3).getTime());
or
Date date=resultSet.getTimestamp();
but the problem was the same.
If I try
Date date=resultSet.getDate();
It throws a NullPointerException.
Can anybody explain this?