@Override
	public void display(ResultSet rs) throws SQLException
	{
		//init cache
		this.rs = rs;
		this.metaData = rs.getMetaData();
		this.data = new LinkedList<>();
		this.dataLength = new int[metaData.getColumnCount()];

		cacheHeaderData();
		cacheRegisterData();

		displayHeaderFooter();

		boolean header = true;
		for(String[] reg : data)  {

			resultBuffer.append("| ");
			for(int i = 0; i < reg.length; i++) {
				resultBuffer.append(String.format("%1$-"+dataLength[i]+ "s", reg[i].replace("\n", " ").replaceAll(" +", " ")));
				resultBuffer.append(" | ");
			}

			if(header) {
				resultBuffer.append("\n|");
				for (int i = 0; i < reg.length; i++) {
					resultBuffer.append("-");
					for (int j = 0; j < dataLength[i]; j++) {
						resultBuffer.append("-");
					}
					resultBuffer.append("-+");
				}
			}

			resultBuffer.append("\n");

			header = false;
		}

		displayHeaderFooter();
	}