1 16 17 package org.apache.cocoon.components.language.markup.xsp; 18 19 import java.sql.SQLException ; 20 import java.sql.ResultSet ; 21 import java.sql.Connection ; 22 23 28 final public class PostgresEsqlQuery extends AbstractEsqlQuery { 29 30 public PostgresEsqlQuery(Connection connection, String query) { 31 super(connection, query); 32 } 33 34 38 private PostgresEsqlQuery(ResultSet resultSet) { 39 super(resultSet); 40 } 41 42 46 public AbstractEsqlQuery newInstance(final ResultSet resultSet) { 47 return(new PostgresEsqlQuery(resultSet)); 48 } 49 50 public String getQueryString() throws SQLException { 51 StringBuffer sb = new StringBuffer (super.getQueryString()); 52 if (getMaxRows() > -1) sb.append(" LIMIT ").append(getMaxRows()+1); 53 if (getSkipRows() > 0) sb.append(" OFFSET ").append(getSkipRows()); 54 return(sb.toString()); 55 } 56 57 public void getResultRows() throws SQLException { 58 setPosition(getSkipRows()); 59 } 60 } 61 | Popular Tags |