It should be enough to call Long.parseLong(timeValue) to get the exception. Why construct a garbage java.sql.Timestamp?