Guest User

Untitled

a guest
Apr 11th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.30 KB | None | 0 0
  1. private void consultarclienteActionPerformed(java.awt.event.ActionEvent evt) {
  2. try {
  3. con = DriverManager.getConnection("jdbc:mysql://localhost/muebleartestefanny", "root", "eafit");
  4. java.sql.Statement sentencia = con.createStatement();
  5. CallableStatement s = con.prepareCall("CALL Cons_Cliente (" + cedulacliente.getText() + " )");
  6. s.execute();
  7. while (s.getResultSet().next()) {
  8. System.out.println(s.getResultSet().GetValue(0));
  9. /*cedulacliente = s.GetValue(0));
  10. string nombre = Convert.ToString(s.GetValue(1));
  11. string apellido = Convert.ToString(s.GetValue(2));
  12. string telefono = Convert.ToString(s.GetValue(3));
  13. string direccion = Convert.ToString(s.GetValue(4));
  14.  
  15. */
  16. cedulacliente.setString(s.getString("Cc_Cliente"));
  17. nombre.addItem(s.getString("Nombre"));
  18. apellido.addItem(s.getString("Apellido"));
  19. telefono.addItem(s.getString("Num_Telefono"));
  20. direccion.addItem(s.getString("Direccion"));
  21.  
  22. }
  23.  
  24. sentencia.close();
  25. con.close();
  26. } catch (Exception ex) {
  27. System.out.println(ex);
  28. }
Add Comment
Please, Sign In to add comment