C
Cruella DeVille
Hi
I'm trying to determin the cardinality of a resultset from a mysql
database, but the method fetchSize() returns 0 (zero). I know there's
data in the database, so this result is not correct. Is there other
ways to retreive the cardinality other than fetchSize()?
My code (if needed)
public String[] getKindergartenNames(){
db.connect();
String[] kindergartenNames = null;
try{
ResultSet s = db.query("select name from kindergarten");
int size = s.getFetchSize();
kindergartenNames = new String[size];
System.out.println("size: " + size); // for debugging purposes
int antall = 0;
while(s.next()){
String name =s.getString("name");
//kindergartenNames[antall] = name;
System.out.println(antall); // debugging
antall++;
}
}catch(SQLException sqlE){
}
return kindergartenNames;
}
I'm trying to determin the cardinality of a resultset from a mysql
database, but the method fetchSize() returns 0 (zero). I know there's
data in the database, so this result is not correct. Is there other
ways to retreive the cardinality other than fetchSize()?
My code (if needed)
public String[] getKindergartenNames(){
db.connect();
String[] kindergartenNames = null;
try{
ResultSet s = db.query("select name from kindergarten");
int size = s.getFetchSize();
kindergartenNames = new String[size];
System.out.println("size: " + size); // for debugging purposes
int antall = 0;
while(s.next()){
String name =s.getString("name");
//kindergartenNames[antall] = name;
System.out.println(antall); // debugging
antall++;
}
}catch(SQLException sqlE){
}
return kindergartenNames;
}