String sql="select ID as \"Batch ID\", NAME as \"Batch Name\",START_DATE as \"Start date\",END_DATE as \"End date\"FROM BATCH order by NAME;";
try {
pst = con.prepareStatement(sql);
rs = pst.executeQuery();
jTable1.setModel(DbUtils.resultSetToTableModel(rs));
}
catch(Exception e) {
JOptionPane.showMessageDialog(null, e);
}
This code returns an error
java.sql.SQLException:ORA-00911:invalid character
I have also tried removing \ from the query and replacing with '. But it didn't work for me
Semicolon character
;is not a part of statement so you need to remove it.