Insert With Stored Procs
Hello All!
I want to do an insert into my database using Stored procedures. I already know how to delete and select.. i'm gonna post part of my code in wich i make a select to give u gives an idea of how im doing the statements.. if there's anything wrong please let me know.
privatevoid MostrarActionPerformed(java.awt.event.ActionEvent evt){
Connection conexion;
Statement sentencia;
ResultSet resultado;
try{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
}
catch (Exception e){
System.out.println("No se pudo conectar con el JDBC-ODBC");
return;
}
try{
conexion = DriverManager.getConnection("jdbc:odbc:con_sql","","" );
sentencia = conexion.createStatement();
String a = ID_E.getText();
int Empleado_ID = Integer.parseInt(a);
resultado = sentencia.executeQuery("exec x "+a);
while(resultado.next() ){
String Name = resultado.getString("Nombre");
String LastName = resultado.getString("Apellido");
Nom.setText(Name);
Ape.setText(LastName);
}
}
catch( Exception e ){
System.out.println( e );
return;
}
}

