-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: retreiving data from oracle database
PostPosted: Tue Jan 22, 2008 8:02 am 
Newbie

Joined: Tue Jan 22, 2008 6:40 am
Posts: 1
Currently i am working with jsf using hibernate.I dont know how to retreive data from table present in the database.Can anyone help with an example code.
Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 22, 2008 1:20 pm 
Newbie

Joined: Tue Jan 22, 2008 5:40 am
Posts: 10
Location: Hungary
No problem, you must edit the hibernate configuration file (hibernate.cfg.xml), and change the database properties. At this time i use mssql, so i don't have oracle example, but i find this for you:

<session-factory>
<property name="connection.username">xxxxx</property>
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="connection.password">xxxxx</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
</session-factory>

You must edit the values in this example. After this, all the hql queries runs in the oracle database.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.