I wrote a program that populates a database with a list of words. Problem is, it throws up the \"Exception in thread \"main\" java.sql.SQLException: near \"s\": syntax error\" e
Use PreparedStatement to avoid problems with erroneous input:
PreparedStatement p = c.prepare("INSERT INTO WORDS (ID,CAT,WORD) VALUES(?, ?, ?)");
p.setInt(1, i);
p.setString(2, wordcat);
p.setString(3, word);
p.execute();
//commit results if using InnoDB, etc