Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Connection c = null;
- Statement stmt = null;
- List<Integer> fixtureNrList = new ArrayList<Integer>();
- try {
- Class.forName("org.sqlite.JDBC");
- c = DriverManager.getConnection("jdbc:sqlite:test.db");
- c.setAutoCommit(false);
- System.out.println("Opened database successfully");
- //
- stmt = c.createStatement();
- ResultSet rs = stmt.executeQuery( "SELECT DISTINCT FixtureNr FROM MATCH;" );
- while ( rs.next() ) {
- Integer nr = rs.getInt("FixtureNr");
- fixtureNrList.add(nr);
- }
- rs.close();
- stmt.close();
- c.close();
- } catch ( Exception e ) {
- System.err.println( e.getClass().getName() + ": " + e.getMessage() );
- //System.exit(0);
- }
- System.out.println("Operation done successfully");
- return fixtureNrList;
Advertisement
Add Comment
Please, Sign In to add comment