| Author |
Using JPA in Java SE environment.
|
Bala Gangadhar
Ranch Hand
Joined: Oct 07, 2008
Posts: 66
|
|
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
Joined: Jul 06, 2009
Posts: 10
|
|
|
The Sun Web site is an amazing place. I found this by googling "jpa desktop applications", Using the Java Persistence API in Desktop Applications.
|
If you don't do data, you don't do diddly!
|
 |
Manuel Alberto Quero
Ranch Hand
Joined: Jul 17, 2009
Posts: 31
|
|
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
Joined: Oct 07, 2008
Posts: 66
|
|
|
Thanks for the reply.
|
 |
 |
|
|
subject: Using JPA in Java SE environment.
|
|
|