所以我需要做一个函数,将采取所有数据从表在我的mysql。我已经找到了查询(它的工作),但问题是如何在java中做到这一点?
public void Print() {
Database db = new Database();
ResultSet rs = null;
rs = db.getData("SELECT * FROM my_table"
+ "INTO OUTFILE 'E:\kurtcobain.csv'"
+ "FIELDS TERMINATED BY ','"
+ "ENCLOSED BY '"'
+ "LINES TERMINATED BY '+n+'");
我试着把一些引号,但仍然错误与"未关闭字符字面量"在第7行。有解决方案吗?由于之前
检查你的代码。缺少(")
public void Print() {
Database db = new Database();
ResultSet rs = null;
rs = db.getData("SELECT * FROM my_table"
+ "INTO OUTFILE 'E:\kurtcobain.csv'"
+ "FIELDS TERMINATED BY ','"
+ "ENCLOSED BY '"'"
+ "LINES TERMINATED BY '+n+'")";