Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

java.sql.SQLException: ResultSet is from UPDATE. No Data.


Hello,

I'm new to Java and I have a problem. I need to export some fields from a MySQL DB to a .csv file. I'm using executeQuery(SELECT...INTO FILE...) and I get this exception:

java.sql.SQLException: ResultSet is from UPDATE. No Data.
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1072)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:986)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:981)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:7158)
at Cell_Monitor.mySqlDB.operationData(mySqlDB.java:110)
at Cell_Monitor.Start.main(Start.java:52)

After I "googled", I understood that it could be a bug or something, but still I don't know how to fix the problem and export the fields. Can u help?10x