I m 采用Pop JbdcTemplate with Postgres。
面对灾后复兴开发银行内部准备的声明的麻烦
My query string is:
private static final String SELECT_ALL_PARTIALLY =
"SELECT login, added FROM admin ORDER BY ? ? OFFSET ? LIMIT ?";
我也想像:
List matches = getJdbcTemplate().query(SELECT_ALL_PARTIALLY,
(new Object[]{
column, // "login" or "added"
order, // "asc" or "desc"
offset,
limit
}),
new RowMapper() {
...
问题在于<代码>。 页: 1 OFFSET...
org.postgresql.util.PSQLException: ERROR: syntax error at or near "$2"
Position: 61
at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:257)
at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statement.java:500)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc2Statement.java:388)
at org.postgresql.jdbc2.AbstractJdbc2Statement.executeQuery(AbstractJdbc2Statement.java:273)
at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:648) ...
我怎么能把这两名持不同立场的人分开?