0
我得到一個錯誤,其中說,SQL異常:java.sql.SQLException:沒有找到數據,我似乎無法找到這裏的問題。請幫助我,抱歉問。SQL異常:java.sql.SQLException:沒有找到數據
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
String url = "jdbc:odbc:ict11";
Connection con = DriverManager.getConnection(url);
Statement statement = con.createStatement();
statement.executeUpdate("DELETE from Employee where EmployeeID ="+txtId.getText()+"");
statement.close();
con.close();
JOptionPane.showMessageDialog(rootPane, "Successfully Deleted");
}
catch(Exception e){
JOptionPane.showMessageDialog(null, e);
}
請問您要刪除的數據存在的開始和結束?但實際上,也不應該拋出異常。 –
您正在使用哪種DBMS? – Vikdor
您正在使用jdbc-odbc驅動程序,不確定但請檢查此[鏈接](http://stackoverflow.com/questions/9498231/java-sql-sqlexception-no-data-found)。可能有幫助。 –