It's not a secret anymore!*
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 Android Security Essentials Live Lessons this week in the Android 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?
 
Similar Threads
my result holding null values
How to delete the row from the Database by using while loop in servlet
JPQL
issue to pass the dynamic value in query
using string as column name in select query?