我必须将数据插入数据库表traindata,但是当我插入数据并通过提交按钮提交时会发生此错误
ORA-00911:invalid character
我可以将我的编码发送到数据表的连接处。
private void subActionPerformed(java.awt.event.ActionEvent evt) {
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
Connection con = DriverManager.getConnection("jdbc:oracle:thin:@ASUS-SUMIT:1521:XE", "system", "pass");
PreparedStatement ps= con.prepareStatement("insert into traindata values(?);");
ps.setString(1, tno.getText());
ps.setString(1, from.getText());
ps.setString(1, to.getText());
ps.executeUpdate();
System.out.println("Data inserted");
con.close();
ps.close();
reset();
JOptionPane.showMessageDialog(this,"Data Insert Successfully!");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null, e.getMessage() ,"Error", 1);
}
}