Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void fillCombo()
- {
- Connection connection = null;
- ResultSet rs = null;
- Statement statement = null;
- try {
- Class.forName("org.sqlite.JDBC");
- connection = DriverManager
- .getConnection("jdbc:sqlite:d:\\dbsql\\pizza.db3");
- statement = connection.createStatement();
- rs = statement.executeQuery("select fahrzeugnr from fahrzeuge");
- while (rs.next())
- {
- jComboBoxMnr.addItem(rs.getString("fahrzeugNr"));
- }
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- finally {
- try {
- rs.close();
- connection.close();
- statement.close();
- } catch (SQLException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement