Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- try{
- String selected = fechainicial.getItemAtPosition(pos).toString();
- String emp = empdisp.getSelectedItem().toString();
- Connection conectar = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=GladiatorSecurityProyecto;user=sa;password=123456789;");
- String guardarServicios = "INSERT INTO [dbo].[Servicios]"+"([NroServicio],[NroCliente],[FechaInicio], [FechaFin],[Tipo],[Celular],[Licencia],[Arma],[Fulltime],[MejorArteMarcial])VALUES"
- + "("+"'"+cedula+"','"+nombreE+"','"+apellidoE+"',"+direccionE+",'"+email+"','"+ celular+"','"+ licencia +"','" +arma+"','"+fulltime+"', '" +espe+")";
- Statement statement = conexion.createStatement();
- statement.executeUpdate(guardarServicios);
- conexion.close();
- JOptionPane.showMessageDialog(null,"El empleado ha sido ingresado correctamente");
- } catch (Exception ex){
- JOptionPane.showMessageDialog(null, "Ha ingresado datos incorrectos, ingreselos nuevamente");
- }
Add Comment
Please, Sign In to add comment