最终选择用POI成功导出excel。总之很有用。

http://www.cnblogs.com/xwdreamer/archive/2011/07/20/2296975.html

http://poi.apache.org/download.html

Student.java

package org.leno.export.util;

import java.util.Date;

public class Student {
    private long id;
    private String name;
    private int age;
    private boolean sex;
    private Date birthday;

    public Student() {
        super();
        // TODO Auto-generated constructor stub
    }

    public Student(long id, String name, int age, boolean sex, Date birthday) {
        super();
        this.id = id;
        this.name = name;
        this.age = age;
        this.sex = sex;
        this.birthday = birthday;
    }

    public long getId() {
        return id;
    }

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

    public String getName() {
        return name;
    }

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

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public boolean getSex() {
        return sex;
    }

    public void setSex(boolean sex) {
        this.sex = sex;
    }

    public Date getBirthday() {
        return birthday;
    }

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

}
View Code

相关文章: