Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Connection con;
- Statement st;
- ResultSet rs;
- JComboBox comboBox = new JComboBox();
- try {
- con=DriverManager.getConnection("jdbc:mysql://localhost:3306/transmax?useSSL=false","test","test");
- st=con.createStatement();
- String s = "select * from przewodnik";
- rs = st.executeQuery(s);
- while(rs.next()){
- comboBox.addItem(rs.getString(4)+ " " + rs.getString(5));
- }
- } finally {
- st.close();
- rs.close();
- con.close();
- }
- panel.add(comboBox);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement