Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- PreparedStatement stl = null;
- ResultSet rs = null;
- Connection con = null;
- public NovoJFrame() {
- initComponents();
- IniciarBD();
- this.PrencherComboBox();
- jPanel3.setVisible(false);
- }
- public void PrencherComboBox(){
- String sql = "Select *from ALUNO";
- try {
- stl = con.prepareStatement(sql);
- rs = stl.executeQuery();
- while(rs.next()){
- jComboBox1.addItem(rs.getString("NOME"));
- }
- } catch(SQLException ex){
- JOptionPane.showMessageDialog(null,ex);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement