用ResultSet读取datetime类型应该用rs.getTimestamp()方法

这个方法返回的数据类型是java.sql.TimeStamp,而TimeStamp是java.util.Date的子类。

所以在JAVABEAN中仍然可以将字段类型定为Date

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.