aspose file tools
The moose likes JDBC and Relational Databases 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
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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?
 
 
subject: How to use CreateNativeQuery to query single value from SQL database value?