-->
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.  [ 4 posts ] 
Author Message
 Post subject: Dynamically Database creation.
PostPosted: Wed Jan 14, 2009 3:13 am 
Newbie

Joined: Wed Jan 14, 2009 3:01 am
Posts: 2
Hi All..

I want to create a database dynamically(using code) through Hibernate in my
DB.
please guide..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 14, 2009 3:29 am 
Beginner
Beginner

Joined: Wed Nov 19, 2008 8:25 am
Posts: 46
Location: Saint Petersburg, Russian Federation
It's not quite clear what do you want to do. If you want to create a database programmatically you can just use jdbc to issue necessary sql commands.

If you want to create a database that reflects your hibernate mapping you can use hbm2ddl tool.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 14, 2009 4:44 am 
Newbie

Joined: Wed Jan 14, 2009 3:01 am
Posts: 2
IN JDBC, for database programming, we must need to give database name during connectivity and then we perform our further sql operation while i want to create that dynamically..i.e first user will enter his new database name(create) then he create table for that database from my wizard..
so here is my actual problem..how can i do that..


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jan 14, 2009 5:30 am 
Beginner
Beginner

Joined: Wed Nov 19, 2008 8:25 am
Posts: 46
Location: Saint Petersburg, Russian Federation
MayankU wrote:
IN JDBC, for database programming, we must need to give database name during connectivity..


That's incorrect in general case. For example, here is a simple program that creates new database for mysql rdbms - sample


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