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.  [ 3 posts ] 
Author Message
 Post subject: checking if schema was already exported
PostPosted: Mon Oct 24, 2005 4:43 am 
Newbie

Joined: Wed Sep 14, 2005 5:13 pm
Posts: 13
Hibernate version:
3.0.5

Name and version of the database you are using:
MySQL 4.1

hello everyone!

when you use "SchemaExport.create(..., ...)" on a database that already
has a schema and contains objects, all objects will be lost.

is there a way to check if a database is already set up with a certain schema?
or can one tell SchemaExport to not drop exisiting records?

thanks for your help in advance!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 24, 2005 4:51 am 
Newbie

Joined: Wed Sep 14, 2005 5:13 pm
Posts: 13
ok, i just answered one part of the question myself...

call SchemaExport.create(..., false) and existing records will not
be killed.

but still: how can i check if a database already contains a certain schema?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 25, 2005 3:07 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
try this ...

org.hibernate.Session.connection()
java.sql.Connection.getDatabaseMetaData().
java.sql.DatabaseMetaData.getTables()


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