Minor changes to tables for device registration phone app integration; these changes...
[iot2.git] / iotjava / iotinstaller / Table.java
index 8e514d6..c3fa5ab 100644 (file)
@@ -234,11 +234,18 @@ public class Table {
         */
        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;
-
        }
 
        /**