当前位置: 技术问答>java相关
在java中怎么把数据库中的数据导出成excel形式的啊?
来源: 互联网 发布时间:2015-07-31
本文导语: - | PrintWriter pw = new PrintWriter(new FileReader("c:my.xls")); while(rs.next()) { String name = rs.getString("name"); String address = rs.getString("address"); pw.println(name+" "+adress); } pw.close(); | ...
-
|
PrintWriter pw = new PrintWriter(new FileReader("c:my.xls"));
while(rs.next())
{
String name = rs.getString("name");
String address = rs.getString("address");
pw.println(name+" "+adress);
}
pw.close();
while(rs.next())
{
String name = rs.getString("name");
String address = rs.getString("address");
pw.println(name+" "+adress);
}
pw.close();
|
PrintWriter pw = new PrintWriter(new FileReader("c:\my.xls"));//少了个
while(rs.next())
{
String name = rs.getString("name");
String address = rs.getString("address");
pw.println(name+" "+adress);
}
pw.close();
while(rs.next())
{
String name = rs.getString("name");
String address = rs.getString("address");
pw.println(name+" "+adress);
}
pw.close();