• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to set Schema name in hibernate

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm having difficulty figuring out a message when running hibernate-based application. It says ...jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0204N "DB2ADMIN.ORDER" is an undefined name. SQLSTATE=42704.

Evidently, the schema name (supposed to be "trial_1") was not used, and user name was used instead. Therefore, the question becomes How I can set up the schema name when doing mapping in hibernate, specifically, in hibernate.hbm.xml, or other places?

Any help would be greatly appreciated!
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can include the schema name in the Properties you configure your SessionFactory with. How you configure those properties its up to you - wether programatically, through hibernate.properties or another config file. The examples I think use hibernate.properties - in which case your schema name is defined in your hibernate.connection.url (you'll have to refer to DB2 docs to check the syntax). Alternatively, if you are running Hibernate for use in a container, you define the schema name where you define the DataSource.
 
reply
    Bookmark Topic Watch Topic
  • New Topic