Meaningless Drivel is fun!*
The moose likes JDBC and the fly likes How to use CreateNativeQuery to query single value from SQL database value? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to use CreateNativeQuery to query single value from SQL database value?" Watch "How to use CreateNativeQuery to query single value from SQL database value?" New topic
Author

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

Jan Pahlen
Greenhorn

Joined: Apr 06, 2011
Posts: 1
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?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to use CreateNativeQuery to query single value from SQL database value?