Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using JPA in Java SE environment.

 
Bala Gangadhar
Ranch Hand
Posts: 104
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
I want develop a simple desktop application. For that i want use JPA to handle the persistance logic.
What are the jar files i need to download ( means where the implementation for JPA spec is available)
Is the Hibernate 3.0 an implementation for JPA specification ?.

Just give me simple steps to wirte a simple java program to store an entity ( at least give me the url where the example available, i have googled for the same and most of them are in J2EE environment, but i need in J2SE)

thanks in advance,
Bala



 
Douglas Graham
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Sun Web site is an amazing place. I found this by googling "jpa desktop applications", Using the Java Persistence API in Desktop Applications.
 
Manuel Alberto Quero
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Bala,

It is possible to use Hibernate as JPA implementation in a J2SE environment.

In order to use Hibernate in a J2SE environment basically you have to configure some parameters (transaction-type="RESOURCE_LOCAL") since you cannot use connection pools and other resources from J2EE application servers.

You can find detailed information in Hibernate documentation:

http://docs.jboss.org/hibernate/stable/entitymanager/reference/en/html/configuration.html

(Go to the sentence "Here is a typical configuration in a J2SE environment" :wink

The way you use Hibernate from your J2SE application is exactly the same as you do from any J2EE application so you can follow any Hibernate example.

Regards,

Manuel
 
Bala Gangadhar
Ranch Hand
Posts: 104
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic