1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| public Vector getInterne() {
Vector v=null;
try{
String sql ="SELECT * FROM HOPITAL";
ConnectionBD mycon = new ConnectionBD();
Statement stmt =mycon.getConnectionDb().createStatement();
ResultSet res=stmt.executeQuery(sql);
v=new Vector();
while(res.next()){
v.addElement(res.getString(2));
}
}catch (Exception e) {
}
return v;
}
//++++++++++++++++
private JComboBox getJComboBox1() {
if (jComboBox1 == null) {
jComboBox1 = new JComboBox();
jComboBox1.setPreferredSize(new Dimension(145, 20));
jComboBox1.addItem(new DataSource().getInterne());
}
return jComboBox1;
} |
Partager