mirror of https://github.com/apache/activemq.git
Merge pull request #480 from jbonofre/AMQ-7368
[AMQ-7368] Add limitQuery in HSQL, MySQL and PostgreSQL JDBC adapters
This commit is contained in:
commit
9200f79982
|
@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue