url: http://paste.minad.de/index.php?nid=398
Notizname: - von: - Sprache:

  1. public String[][] getTest() {
  2. String[][] table = null;
  3. try {
  4. Statement stmt = connection.createStatement();
  5. ResultSet rs = stmt.executeQuery("SELECT * FROM test;");
  6. int i = 0;
  7. while (rs.next()) {
  8. table[i][0] = rs.getString("id");
  9. table[i][1] = rs.getString("name");
  10. table[i][2] = rs.getString("zeit");
  11. table[i][3] = rs.getString("kommentar");
  12. i++;
  13. }
  14. rs.close();
  15. stmt.close();
  16. System.out.println("table loaded");
  17.  
  18. } catch (Exception e) {
  19. System.out.println( e.getClass().getName() + ": " + e.getMessage() );
  20. }
  21. return table;
  22. }
Pastelog:
erstellt 2014.05.23 10:08:54
Hits
558




© 2009-2010 rellig