Re: how to Escape single quotes with PreparedStatment

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: how to Escape single quotes with PreparedStatment
Дата
Msg-id CA+0W9LNEMxVVkGACi2MQ+dxFZ_Q-XQ81GWenfmcnzqSkEjmFnQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: how to Escape single quotes with PreparedStatment  (JavaNoobie <vivek.mv@enzentech.com>)
Ответы Re: how to Escape single quotes with PreparedStatment
Список pgsql-jdbc
On 22 August 2011 22:26, JavaNoobie <vivek.mv@enzentech.com> wrote:

>  String query="SELECT count(*) over () as ROWCOUNT,
> CONSUMER_ID,WENEXA_ID,CONSUMER_NAME,CONTACT_NO,residing_village from
> db_consumer WHERE lower(CONSUMER_NAME) LIKE (lower(?))OR (lower(?)='')  AND
> (lower(RESIDING_VILLAGE) LIKE (lower(?) OR (lower(?)='')) AND
> (lower(WENEXA_ID) LIKE (lower(?))OR(lower(?)='')) LIMIT ? OFFSET ?";

> It throws the previous error:org.postgresql.util.PSQLException: ERROR:
> syntax error at or near "LIMIT"
>  Position: 302
>        at
> org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2102)
>        at
> org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:1835)
> Any idea why this could be happening?

You have a syntax error in your query, just like the errors says.
Count the parentheses.

(I really can't believe this thread is still going)

Oliver

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Chris Wareham
Дата:
Сообщение: Re: how to Escape single quotes with PreparedStatment
Следующее
От: Radosław Smogura
Дата:
Сообщение: Re: how to Escape single quotes with PreparedStatment