private List<DbTableRecord> getRecordsFromDb(Connection dbConnection,
			DbTableDefinition tableDefinition) {

		List<DbTableRecord> allRecords = new ArrayList<DbTableRecord>();
		DbTableRecord currentRecord = null;
		try {
			// Create and execute an SQL statement that returns some data.
			stmt = dbConnection.createStatement();
			rs = stmt.executeQuery(tableDefinition.getSqlQuery());
			// Iterate through the data in the result set and display it.
			while (rs.next()) {
				currentRecord = new DbTableRecord();
				int pkHashCode = this.getClass().hashCode();

				String[] recordPkValues = new String[tableDefinition
						.getPkColumns().size()];
				int pkColumnIndex = 0;
				for (String pkColumn : tableDefinition.getPkColumns()) {
					String columnValue = rs.getString(pkColumn);
					pkHashCode = (pkHashCode * HASH_MULTIPLIER)
							^ columnValue.hashCode();

					recordPkValues[pkColumnIndex++] = columnValue;
				}
				currentRecord.set_primaryKey(Integer.toString(pkHashCode));
				currentRecord.set_primaryKeys(recordPkValues);

				int columnIndex = 0;
				String[] recordValues = new String[tableDefinition
						.getTableColumns().size()];

				for (String columnName : tableDefinition.getTableColumns()) {
					String columnValue = rs.getString(columnName);
					recordValues[columnIndex++] = columnValue;
				}
				currentRecord.set_values(recordValues);
				allRecords.add(currentRecord);
			}
		} catch (Exception ex) {
			ex.printStackTrace();
			logger.fatal(Utils.buildExceptionMessage(ex));
			logger.info("The application has exited...");
			System.exit(0);	
		} finally {
			if (rs != null)
				try {
					rs.close();
				} catch (Exception e) {
				}
			if (stmt != null)
				try {
					stmt.close();
				} catch (Exception e) {
				}
		}
		return allRecords;
	}