Guest User

Untitled

a guest
Nov 17th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. public class adm_pedidos extends javax.swing.JFrame {
  2. /**
  3. * Creates new form adm_pedidos
  4. */
  5.  
  6. Connection cn = null;
  7. Statement stm = null;
  8. PreparedStatement ps = null;
  9. ResultSet rs = null;
  10. String sql = null;
  11.  
  12. public adm_pedidos() {
  13. initComponents();
  14. mostrarpedidos();
  15. llenar_combo_actividad();
  16. llenar_combo_usuarios();
  17. this.setLocationRelativeTo(null);
  18. this.setResizable(false);
  19. }
  20.  
  21. private void llenar_combo_actividad() {
  22. try {
  23. sql="select distinct(codigo_actividad),descripcion from activida_gasto";
  24. cn = accesodb.getConnection();
  25. stm= cn.createStatement();
  26. rs=stm.executeQuery(sql);
  27. System.out.println(sql);
  28. while(rs.next()){
  29. cbxactividad.addItem(rs.getString(2));
  30. }
  31. }catch(Exception e){
  32. JOptionPane.showMessageDialog(rootPane, e);
  33. }
  34. }
  35.  
  36. rs = stm.executeQuery(sql);
  37.  
  38. rs = stm.executeQuery(sql).getResultSet();
Add Comment
Please, Sign In to add comment