Win a copy of Rust Web Development this week in the Other Languages forum!
  • 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Programatic Schema Export with Hibernate and EJB3

 
Ranch Hand
Posts: 105
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am developing J2SE Application with Hibernate and HSQL database and I want db schema to be created programatically.

I following EJB3 - JPA approach and using persistence.xml as show below.



To Use SchemaExport API, I need hibernate configuration, so I am trying to get hibernate cfg out of EJB 3 configuration. This is what I tried..



SEVERE: Error parsing XML: /META-INF/persistence.xml(1) Document is invalid: no grammar found.

Please help me in knowing right way of exporting schema using EJB3/hibernate. My basic requirement is tables to be created automatically only if they does not exist, Please let me know if there are better way of doing it...


Any help would be very much appreciated..

Thanks,
Raja.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic