0

How do I create a custom SQL command and override the automatic handling in the netBeans project?

2
  • Can you be more specific? What "automatic handling" are you talking about? Commented May 4, 2011 at 3:06
  • So my Netbeans project uses something called EntityManager and we'd like to bypass it (download.oracle.com/javaee/5/api/javax/persistence/… ) Commented May 4, 2011 at 4:54

1 Answer 1

1

The EntityManager is part of the Java Persistence API (JPA). You're either setting it up yourself or your server (persumably Glassfish inside NetBeans?) is setting it up for you.

Here's a quick example of what you can do:

Query query = entityManager.createNativeQuery("select name from people");
List<String> results = query.getResultList();

This is a more complete example.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.