我正在尝试在数据库中保存值,但出现此错误
我试过这个
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
try {
// TODO add your handling code here:
captureScreen("img.jpg");
} catch (Exception ex) {
Logger.getLogger(frontendUI.class.getName()).log(Level.SEVERE, null, ex);
}
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("driver loaded");
}
catch(ClassNotFoundException ex) {
System.out.println("driver not loaded");
}
String URL = "jdbc:oracle:thin:@localhost:1521:xe";
String Username = "system";
String Password = "toushif";
try {
con = DriverManager.getConnection(URL,Username,Password);
st=(Statement) con.createStatement();
String sql="insert into TOU3(file123) values('"+abc+"')";
st.executeUpdate(sql);
}
catch(Exception e) {
e.printStackTrace();
}
/**
* @param args the command line arguments
*/
}