[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.rt.eclipselink] Re: Eclipselink queries on DB2

Here is one of the examples. This is error eclipse returns:

[EL Warning]: 2009.07.30 09:52:21.265--UnitOfWork(14832679)--Exception [EclipseLink-4002] (Eclipse Persistence Services
- 1.0.2 (Build 20081024)): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: [BEA][DB2 JDBC Driver][DB2]STRING TO BE PREPARED CONTAINS INVALID USE OF PARMETER MARKERS
Error Code: -418
Call: SELECT ID, VERSION, CODE, ROLE, DESCRIPTION, DATASOURCE, TITLESTYLE FROM RE1REPORT WHERE (((? IS NULL) OR (CODE LIKE ?)) AND ((? IS NULL) OR (DESCRIPTION LIKE ?)))
bind => [null, null, null, null]
Query: ReadAllQuery



and this is the JPA query:

select r from Report r where (:code is null or r.code like :code)
and (:description is null or r.description like :description)

where :code and :description are given query parameters.

It makes no difference whether you set values to these parameters or leave them NULL.