-->
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.  [ 6 posts ] 
Author Message
 Post subject: Is it possible to create database with hibernate?
PostPosted: Tue Mar 16, 2004 4:59 am 
Beginner
Beginner

Joined: Wed Nov 19, 2003 3:08 pm
Posts: 20
Hi folks!

Is it possible to create database & table's to it with hibernate?
Any properties??

Artsi


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 16, 2004 5:20 am 
Beginner
Beginner

Joined: Tue Mar 16, 2004 5:15 am
Posts: 33
Take a look on import net.sf.hibernate.tool.hbm2ddl.SchemaUpdate. It creates the required table-structure for all your mappings.

I guess Hibernate is not able to create a database on its own, since it is not the task it was build for. Take a look at HSQLDB. Its a lightweight DBMS written entirely in Java. It is supported by Hibernate and suites well for small and midsize DBs.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 16, 2004 6:18 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
do you know hibernate comes with a full doc?
please read it
http://www.hibernate.org/hib_docs/refer ... guide.html


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 16, 2004 6:38 am 
Beginner
Beginner

Joined: Wed Nov 19, 2003 3:08 pm
Posts: 20
Yes i know documents, i have consult them, and also tried google to find any information creating database with hibernate (like in sql (mysql) (CREATE DATABASE...)) but currently any document i have found, is from driven some grep agains sources.

It seems that its not possible to create database with hibernate, maby it's possible with jdbc, not tested yet.

Artsi


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 16, 2004 6:40 am 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
just use ant task coupled with SchemaExport using your mySql jdbc driver, it works great!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 17, 2004 10:28 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Hibernate don't create databases, it can create/update schemas

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 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.