日期:2014-05-20  浏览次数:20691 次

ResultSet类中getDate方法的参数可以用util包中的Date对象吗
Date类总共有两个,一个是util包中的Date类,包括时间,一个是sql包中的Date类,只包含日期
后者是前者的子类,所以我就碰见了一个问题,在ResultSet类中的getDate()方法参数可以用util包中的Date类吗
------解决方案--------------------
数据类型一直的话,就么问题
------解决方案--------------------
遇到问题查API文档是个好习惯,可以很快解决你的疑惑
------解决方案--------------------
jdbc中我用的是sql的date
------解决方案--------------------
getDate

Date getDate(int columnIndex)
             throws SQLException

    Retrieves the value of the designated column in the current row of this ResultSet object as a java.sql.Date object in the Java programming language. 

----------------------------
api文档标记的很清楚。