• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

Can not run JPA sample example using J2SE

 
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am reading "Pro JPA2" book by Mike.
I am trying to execute JPA example (given in Chapter 2) using J2SE . I am using MYSQL DB.
here is the code








Persistence.xml file



I have created all these above mentioned files but now i am not able to run it using J2SE
Please let me know how can i package it and run it using J2SE?
What will be mandatory lib/jar files that i require to run this code successfully?
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ItDoesntWorkIsUseless. What kind of error do you have ?
 
Abhay Agarwal
Ranch Hand
Posts: 1376
Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

Putting my question in different way

I want to know the steps that i should follow to run a sample JPA code (as mentioned above in my post) in a J2SE eniv.
I have got all code ready but do not know how to run it for eg - what are the dependent lib/jars that i will require, what will be folder structure in which i should organize my above mentioned code etc ?

Thanks
Abhay
 
Rancher
Posts: 43009
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The folder structure is immaterial - choose whatever you like. The way you run your code is also immaterial - Ant, Maven, command line, from a script - whatever way you're comfortable with will work. There's nothing special about JPA in that regard.

The libraries you need are a) JPA, 2) the JDBC driver for your DB, and c) the libraries that make up whatever JPA implementation you're using (for example, OpenJPA, Hibernate or EclipseLink).
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!