public static Tuple[] fromResultSet(ResultSet in) throws SQLException {
		List<Tuple> res = new ArrayList<Tuple>();
		int colCount = in.getMetaData().getColumnCount();
		boolean empty = !in.next();
		while (!in.isAfterLast() && !empty) {
			Object[] objects = new Object[colCount];
			for (int i = 0; i < colCount; i++)
				objects[i] = in.getObject(i + 1);
			res.add(new Tuple(objects));
			in.next();
		}
		DatabaseManager.clean(in);
		return res.toArray(new Tuple[] {});
	}