• 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: 17309
11
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
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!