public class MekleFrame extends javax.swing.JFrame { Connection conn = null; ResultSet rs = null; PreparedStatement pst = null; Statement st = null; /** * Creates new form MekleFrame */ public MekleFrame() { initComponents(); this.setLocationRelativeTo(null); this.setResizable(false); jTextFielddummy.setVisible(false); conn = dbConnection.ConnectDB(); update_table(); pop_combo(); } private void pop_combo(){ try { //String cnsCo=jComboCins1.getSelectedItem().toString(); String sql = "SELECT * from cinsdb WHERE sinif= ?"; pst=conn.prepareStatement(sql); //pst.setString(1,cnsCo); pst.setString(1,String.valueOf(jComboCins1.getSelectedItem())); rs=pst.executeQuery(); while (rs.next()) { String cinsad = rs.getString("cinsad"); jComboCinsM.addItem(cinsad); } } catch(Exception e){ JOptionPane.showMessageDialog(null, e); } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)