public String[][] getRows(String name, String[] columnNames, SortFilterState sortFilter, int start, int pageSize) {
		List<String[]> result = new LinkedList<String[]>();
		
		StringBuilder sb = new StringBuilder();
		sb.append("SELECT ");

		for (int i = 0; i < columnNames.length; ++i) {
			sb.append(columnNames[i]);
			if (i < columnNames.length - 1) {
				sb.append(",");
			}
		}
	
		sb.append(" FROM ");
		sb.append(name);
		sb.append(" WHERE 1=1 ");
		
		for (Entry<String, String> filter : sortFilter.getFilter()) {
			sb.append("AND ");
			sb.append(filter.getKey());
			sb.append(" LIKE '%");
			sb.append(filter.getValue());
			sb.append("%' ");
		}
		
		Entry<String, Sort> sort = sortFilter.getSort();
		if (sort != null) {
			sb.append("ORDER BY " + sort.getKey());
			sb.append(sort.getValue() == Sort.ASC ? " ASC" : " DESC");
		}
		
		
		String query = sb.toString();
		query = String.format(
			"SELECT * FROM (SELECT x0.*, ROWNUM as rnum FROM  (%s) x0) WHERE rnum >=  %s AND rnum < %s", sb, start, start + pageSize);
		
		Statement st = null;
		try {
			st = conn.createStatement();
		
			ResultSet rs = st.executeQuery(query);
			while (rs.next()) {
				String[] row = new String[columnNames.length];
				for (int i = 1; i < columnNames.length + 1; ++i) {
					row[i - 1] = rs.getString(i);
				}
				
				result.add(row);
			}
			
		} catch (SQLException e) {
			e.printStackTrace();
		} finally {
			try {
				st.close();
			} catch (SQLException e) {
				e.printStackTrace();
			}
		}
		
		return result.toArray(new String[][]{{}});
	}