Merge pull request #480 from jbonofre/AMQ-7368

[AMQ-7368] Add limitQuery in HSQL, MySQL and PostgreSQL JDBC adapters
This commit is contained in:
Jean-Baptiste Onofré 2020-02-29 07:05:43 +01:00 committed by GitHub
commit 9200f79982
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 0 deletions

View File

@ -30,4 +30,9 @@ public class HsqldbJDBCAdapter extends BytesJDBCAdapter {
super.setStatements(statements); super.setStatements(statements);
} }
@Override
public String limitQuery(String query) {
return query + " LIMIT " + getMaxRows();
}
} }

View File

@ -96,4 +96,10 @@ public class MySqlJDBCAdapter extends DefaultJDBCAdapter {
public void setTypeStatement(String typeStatement) { public void setTypeStatement(String typeStatement) {
this.typeStatement = typeStatement; this.typeStatement = typeStatement;
} }
@Override
public String limitQuery(String query) {
return query + " LIMIT " + getMaxRows();
}
} }

View File

@ -48,4 +48,5 @@ public class OracleJDBCAdapter extends DefaultJDBCAdapter {
public String limitQuery(String query) { public String limitQuery(String query) {
return "SELECT * FROM (" + query + ") WHERE ROWNUM <= " + getMaxRows(); return "SELECT * FROM (" + query + ") WHERE ROWNUM <= " + getMaxRows();
} }
} }

View File

@ -54,4 +54,10 @@ public class PostgresqlJDBCAdapter extends BytesJDBCAdapter {
public void setAcksPkName(String acksPkName) { public void setAcksPkName(String acksPkName) {
this.acksPkName = acksPkName; this.acksPkName = acksPkName;
} }
@Override
public String limitQuery(String query) {
return query + " LIMIT " + getMaxRows();
}
} }