Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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");
- }
- }
- 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"); }
Add Comment
Please, Sign In to add comment