Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can I specify Oracle database schema in hibernate.cfg.xml ?

 
ben oliver
Ranch Hand
Posts: 375
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in hibernate.cfg.xml we can specify the jdbc url, dialect. But you can't specify which schema you want to use, can you ? That means if I use oracle, I have to include that information in HQL ? is there any place I can specify that in any configuration file ?
 
Mahesh Gurav
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can write database schema name as an attribute in XX.hbm.xml file as follows.
<hibernate-mapping>
<class name="com.abc" schema="cr" table="AB_C">
--
</class>
</hibernate-mapping>
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
...or you can include it in the connection URL, just as you might in plain old JDBC.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic