我MysqlToXls
从这里复制了课程:http:
//mikescode.wordpress.com/2008/02/16/exporting-a-mysql-table-to-excel-xls-in-java/
我以这种方式编辑了创建不需要任何参数的构造函数的类:
public MysqlToXls()
throws ClassNotFoundException, SQLException {
// Create MySQL database connection
Class.forName("com.mysql.jdbc.Driver");
String url = "jdbc:mysql://localhost/Spinning?user=root&useUnicode=true&characterEncoding=utf8";
connection = DriverManager.getConnection(url);
}
虽然没有任何指南,但我尝试自己做,但我做不到。
MysqlToXls m=new MysqlToXls();
m.generateXls("utente", "utenti.xls");
但是没有错误,文件 utenti.xls 保持空白。有人知道问题出在哪里吗?