Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

createNativeQuery using parameter in select LIKE statement

843830Aug 16 2006 — edited Jun 26 2008
Can I use setParameter on native query (createNativeQuery) using LIKE in select statement?

I have the following code and it doesn't work:
.........
Query qry = manager.createNativeQuery("Select * from Type as t where t.typeid LIKE '%?1%'", Type.class);
qry.setParameter(1, "2");
.........

Thanks.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 24 2008
Added on Aug 16 2006
2 comments
839 views