关于将生日()插入到数据库中出错
public void add(Customer c){
Connection conn = null;
PreparedStatement st = null;
ResultSet rs = null;
try{
conn = JdbcUtils.getConnection();
String sql = "insert into customer(id,name,gender,birthday,cellphone,email,preference,type,description) values(?,?,?,?,?,?,?,?,?)";
st = conn.prepareStatement(sql);
st.setString(1, c.getId());
st.setString(2, c.getName());
st.setString(3, c.getGender());
st.setDate(4,new java.sql.Date(c.getBirthday().getTime()));
以上是部分代码,在最后一行插入生日时,显示“The method getTime() is undefined for the type String”错误,在网上查好像关于时间的存储就是:new java.sql.Date(date.getTime());我加到里面也是显示没有date类型。请教大神给点意见,该怎么改。。。