下面的代碼顯示一個空指針異常。但我無法找到它在哪裏。這是我的sql數據庫。如何解決這個問題?如何找到空指針異常在哪裏
try {
DefaultTableModel d=(DefaultTableModel) jTable3.getModel();
for(int x=0;x<d.getRowCount();x++){
double npu=Double.parseDouble(jTable3.getValueAt(x, 7).toString());
double ns=Double.parseDouble(jTable3.getValueAt(x, 8).toString());
double dis=Double.parseDouble(jTable3.getValueAt(x, 9).toString());
int qty=Integer.parseInt(jTable3.getValueAt(x, 10).toString());
JM.putdata("INSERT INTO stock VALUES('"+jTable3.getValueAt(x, 0).toString()+"','"+jTable3.getValueAt(x, 1).toString()+"','"+jTable3.getValueAt(x, 2).toString()+"','"+jTable3.getValueAt(x, 3).toString()+"','"+jTable3.getValueAt(x, 4).toString()+"','"+jTable3.getValueAt(x, 5).toString()+"','"+jTable3.getValueAt(x, 6).toString()+"','"+npu+"','"+ns+"','"+dis+"','"+qty+"','"+jTable3.getValueAt(x, 11).toString()+"')");
}
} catch (Exception e) {
JOptionPane.showMessageDialog(rootPane, e, "ERROR", JOptionPane.ERROR_MESSAGE);
}