开发者

How can I call my own custom SQL code inside my Java EE project on NetBeans

How do I create a custom SQL command and override the automatic handling in开发者_运维知识库 the netBeans project?


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜