/** Execute the query and get the results. */ public void load(int startRow, int length) throws KExceptionClass { bindDBtransaction( dbTransactionClient, " SELECT " + selectSQL + " FROM " + tableName + finalWhere + finalOrder); // Query DB try { KMetaUtilsClass.cursorWait(parentWindow); KMetaUtilsClass.setProgressBarValue1(60); dbTransactionClient.executeQuery(startRow, length); KMetaUtilsClass.setProgressBarValue1(100); } finally { KMetaUtilsClass.cursorNormal(parentWindow); } if (!dbTransactionClient.columnNamesList.contains(keyField)) { throw new KExceptionClass( "*** Could not load data **** \n" + "Key field [" + keyField + "] was not found in result set", null); } firstLoadReady = true; log.log(this, "dbTransactionClient rowCount = " + dbTransactionClient.rowCount()); log.log(this, "dbTransactionClient startRow = " + dbTransactionClient.resultSetStart()); }
/** get number of rows being loaded */ public int getloadedRowCount() throws KExceptionClass { if (!firstLoadReady) throw new KExceptionClass( "*** Data Loading error **** \n" + "Can not return row count before data loading...", null); return dbTransactionClient.rowCount(); }