我正在为我的学者们开发一个dbms的迷你项目,我已经编写了下面的代码来插入细节,但当我点击插入它没有服用。我也没有看到任何错误..请帮忙。
使用Netbeans和runql命令行..
try{
Class.forName("oracle.jdbc.OracleDriver");
String t_id = tid.getText();
String tname = tnamme.getText();
String quali = qualifi.getText();
String phn_no=phn.getText();
String gender = gendr.getText();
String bdate = birth.getText();
String address=addr.getText();
Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@VAIO:1521:xe","system","system");
Statement st = conn.createStatement();
st.executeUpdate("insert into staff1 values('"+t_id+"','"+tname+"','"+quali+"','"+phn_no+"','"+gender+"','"+bdate+"','"+address+"')");
JOptionPane.showMessageDialog(null,"Inserted Successfully!!" );
tid.setText("");
tnamme.setText("");
qualifi.setText("");
phn.setText("");
gendr.setText("");
birth.setText("");
addr.setText("");
st.close();
conn.close();
}catch( ClassNotFoundException | SQLException e){
System.out.println(e);
}
}