• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to use CreateNativeQuery to query single value from SQL database value?

 
Jan Pahlen
Greenhorn
Posts: 1
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

using a CRUD and want to access a certain value in the databse. what I tried is:

Query query = em.createNativeQuery("select o from Table o where o.IDfield= '938'");
Table o = (Table)query.getSingleResult();

but this fails.

Any suggestions?
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic