Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA Example

 
Nikhil Jain
Ranch Hand
Posts: 392
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I was trying JPA Example on stand alone java.

<?xml version="1.0" encoding="UTF-8"?>
<persistence>
<persistence-unit name="employee">
</persistence-unit>
</persistence>

I successfully executed the example through container.
How would one give connection details through persitence.xml. I am using my sql.

SHASHANK
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Shashank Tilwalli:
Hi,
I was trying JPA Example on stand alone java.

<?xml version="1.0" encoding="UTF-8"?>
<persistence>
<persistence-unit name="employee">
</persistence-unit>
</persistence>

I successfully executed the example through container.
How would one give connection details through persitence.xml. I am using my sql.

SHASHANK


So I would highly recommend using a good tutorial online or buying a good book on JPA or reading the JPA spec. In those they will cover the persistence.xml right in the very beginning.

For books I recommend two.

Java Persistence with Hibernate from Manning Press
http://www.manning.com/bauer2/
and
Pro EJB3 http://www.apress.com/book/view/1590596455

Mark
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic