-->
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: hibernate databases
PostPosted: Tue Oct 21, 2008 7:41 am 
Newbie

Joined: Tue Sep 09, 2008 2:30 am
Posts: 10
How can i create a new database with hibernate?
If the database exists hibernate works correctly, but if it has to create the database, it does not do it. Somebody can put some example to me?
Bye!


Top
 Profile  
 
 Post subject: Re: hibernate databases
PostPosted: Tue Oct 21, 2008 11:07 am 
Newbie

Joined: Thu Oct 09, 2008 4:03 pm
Posts: 16
Location: US, Itasca Illinois
I'm really new to Hibernate, but I don't think you can automatically create a brand new database using Hibernate all by itself. Perhaps there is some add-on tool that I'm not aware of. What I did was to download a free copy of Oracle 10G from http://www.oracle.com/technology/softwa ... nsoft.html

I then downloaded free SQL Developer from http://www.oracle.com/technology/softwa ... index.html

I used SQL Developer GUI menu to create my database and tables, very easy. Of course it will have to be fine-tuned as it grows. For more advanced DBA tuning, security, ect, you will need to download Oracle Enterprise free edition.

Once you have the SQL Developer tool installed that allows you to create a database, you would need to adjust the entry in your Hibernate config file:

<!-- Database connection settings -->
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@localhost:1521:DatabaseName</property>
<property name="connection.username">userName</property>
<property name="connection.password">passwordValue</property>
<property name="hibernate.connection.autocommit">false</property>

Finally, you will need a corresponding database driver. For Oracle 10G, you can download ojdbc14.jar and place it in your lib directory.

Here is a link specific to Hibernate database tables:
http://www.allapplabs.com/hibernate/hib ... cripts.htm

Regards,
Lynette


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.