CoboCards App FAQ & Wishes Feedback
Language: English Language
Sign up for free  Login

This flashcard is just one of a free flashcard set. See all flashcards!

All main topics / Informaticsk / DBS1 / Hiesch_Datenbankprogrammierung_Datenbankentwurf
37
Anzahl der Zeilen herausfinden
SQL
Statement s = cd.createStatement();
ResultSet r = s.executeQuery("SELECT COUNT(*) AS rowcount FROM TableName");
r.next(); //immer eins weiter, da sonst null
int count = r.getInt("rowcount");
r.close();
System.out.println("MyTable has " + count + " row(s).");

COUNTER
int counter =0;
while (rset.next())
{
counter ++
}
System.out.println("MyTable has " + counter + " row(s).");

Cursor
rs.last();
int rows = rs.getRow();
System.out.println("MyTable has " + rows+ " row(s).");
New comment
Flashcard info:
Author: learner94
Main topic: Informaticsk
Topic: DBS1
Published: 26.08.2017

Cancel
Email

Password

Login    

Forgot password?
Deutsch  English