*/
public boolean isTableEmpty() {
- if (rs == null) {
- return true;
+ // Check if this table has any entries
+ String strCommand = "SELECT * FROM " + strTableName;
+ rs = sqlInterface.sqlCommandQuery(strCommand);
+ try {
+ if (!rs.first()) {
+ return true;
+ }
+ } catch(SQLException ex) {
+ System.out.println("Table: Exception: ");
+ ex.printStackTrace();
}
return false;
-
}
/**