請我有一個病人的病歷在餐桌 代碼傳輸數據使用了一點問題:問題的病人記錄在表檔案傳輸數據
try {
//Statement mystt = (Statement) conn.createStatement();
int row= affichagetable_pt.getSelectedRow();
String Table_click=(affichagetable_pt.getModel().getValueAt(row, 0).toString());
String query="insert into archives_pt (numfiche_pt,datefiche_pt,nom_pt,prenom_pt,datenaissance_pt,gsm_pt,cin_pt,profession_pt,sexe_pt,adresse_pt,nomsons_pt,cinsons_pt) select numfiche_pt,datefiche_pt,nom_pt,prenom_pt,datenaissance_pt,gsm_pt,cin_pt,profession_pt,sexe_pt,adresse_pt,nomsons_pt,cinsons_pt from patient where patient.numfiche_pt='"+Table_click+"'";
pst=conn.prepareStatement(query);
rs=pst.executeQuery();
JOptionPane.showMessageDialog(null,"Effacement OK");
pst.close();
} catch (Exception e2) {
// TODO: handle exception
JOptionPane.showMessageDialog(null,e2);
}
錯誤:
E2消息 「的說法,並沒有返回結果集」
你需要了解,理解和在bobby表訪問之前開始使用參數化查詢。 http://bobby-tables.com/ –
你能把這個錯誤信息翻譯成英文嗎? –
請發佈您的e2而不是隻是消息的完整堆棧跟蹤。使用e2.printStackTrace();並在這裏複製控制檯日誌。 –