0
Jdeveloper 11gからSQL Serverテーブルにデータを挿入しようとしていますが、何とか動作しません。Jdeveloper 11gからSQL Serverテーブルにデータを挿入
は、ここに私のコードです:
public void theQuery(String query) {
Statement statement = null;
Connection connection = null;
try {
connection = DriverManager.getConnection("jdbc:sqlserver://localhost/PROGRAII","root","");
statement = connection.createStatement();
statement.executeUpdate(query);
JOptionPane.showMessageDialog(null, "Se realizó la operación");
}
catch (Exception ex) {
JOptionPane.showMessageDialog(null, "NO se realizó la operación");
}
}
そして、これは文字列です:私はあなたが"'"+this.jTexEmail.getText()
に","+this.jTexEmail.getText()
を交換する必要があると思う
private void jButAceptar_actionPerformed(ActionEvent e) {
try {
inserta.theQuery("insert into ControlAcceso(cedula,email,clave) values('"+this.jTexCedula.getText()+"'," + ","+this.jTexEmail.getText()+"','"+this.jTexClave.getText()+"')"); } catch (Exception ex) {
JOptionPane.showMessageDialog(null, "No se realizo el query"); }