java中ResultSet.getDate()读取正常,但是放到list中却读取出null值?

这是Student类
package JDBCTest;

import java.util.Date;

public class Student {
private int id;
private String name;
private boolean gender;
private Date birthday;
public Student() {
}

public Student(int id, String name, boolean gender, Date birthday) {
    this.id = id;
    this.name = name;
    this.gender = gender;
    this.birthday = birthday;
}

public int getId() {
    return id;
}

public void setId(int id) {
    this.id = id;
}

public String getName() {
    return name;
}

public void setName(String name) {
    this.name = name;
}

public boolean isGender() {
    return gender;
}

public void setGender(boolean gender) {
    this.gender = gender;
}

public Date getBirthday(java.sql.Date birthday) {
    return this.birthday;
}

public void setBirthday(Date birthday) {
    this.birthday = birthday;
}

@Override
public String toString() {
    return "Student{" +
            "id=" + id +
            ", name='" + name + '\'' +
            ", gender=" + gender +
            ", birthday=" + birthday +
            '}';
}

}

package JDBCTest;

import java.sql.*;

public class Demo6 {
public static void main(String[] args) throws SQLException {
Student student = new Student();
Connection conn = JdbcUtil.getConnection();
PreparedStatement ps = conn.prepareStatement("select * from stu1 where id =?");
ps.setInt(1,2);
ResultSet rs = ps.executeQuery();
if (rs.next()){
student.setId(rs.getInt("id"));
student.setName(rs.getString("name"));
student.setGender(rs.getBoolean("gender"));
student.getBirthday(rs.getDate("birthday"));
}
System.out.println(rs.getDate("birthday"));
JdbcUtil.close(conn, ps, rs);
System.out.println(student);
}
}
为什么这段代码中rs.getDate("birthday")读取是正常的,但是
student.getBirthday(rs.getDate("birthday"));读取出来的却是null值?

public Date getBirthday(java.sql.Date birthday) {
    return this.birthday;
}

你怕不是在逗我,你这里传入了一个Date,然后传出了类自己的Date,这两个变量根本没关系,返回的值是是类初始化的。

if (rs.next()){
    student.setId(rs.getInt("id"));
    student.setName(rs.getString("name"));
    student.setGender(rs.getBoolean("gender"));
    student.getBirthday(rs.getDate("birthday"));
}

在这个里面第四句你应该是想setBirthday吧,从上面读下来也应该是set,不知道你这个什么意思。

你都没set怎么get啊大哥