-->
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.  [ 8 posts ] 
Author Message
 Post subject: Auto SchemaUpdate Question
PostPosted: Mon Jul 19, 2004 7:05 pm 
Newbie

Joined: Tue May 04, 2004 6:31 pm
Posts: 11
Hello All,

Short Version:

Does SchemaUpdate work with MS SQL Server?


Long Version:

I use three database servers
  1. Oracle 9i
  2. MySQL
  3. MS SQL Server


I've had limited success in getting SchemaUpdate to work with MySQL and no success getting it to work with MS SQL Server. I spent quite some time trying to debug it with MS SQL Server and then I realized that SchemaUpdate might not even work with SQL server.

Is there a master list somewhere that says what SchemaUpdate works with?

Thanks!
--
Nathan


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jul 19, 2004 7:06 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
To be honest, no-one is really maintaining this tool. So unless someone takes on responsibility for it, I can't really guarantee it will work anywhere.


Top
 Profile  
 
 Post subject: recommendation
PostPosted: Tue Jul 20, 2004 4:47 pm 
Newbie

Joined: Tue May 04, 2004 6:31 pm
Posts: 11
What do you recommend?

I can code in the create table statements and use the java.sql.Statement class to run the "execute" method. The problem with that is that I am creating the tables outside of hibernate...

Is there a better way?

(essentially, I am programming a web app and I have been doing the development on a mysql database server. I am at the point where I am going to hand off the application to another party and I was trying to make deployment as easy as possible... So I was thinking of how to automatically create the tables.)

Thanks!
--
Nathan


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 20, 2004 4:56 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can automatically _create_ the tables with schemaExport. But updating the table structure with SchemaUpdate is highly unsuported.


Top
 Profile  
 
 Post subject: schemaExport
PostPosted: Tue Jul 20, 2004 6:48 pm 
Newbie

Joined: Tue May 04, 2004 6:31 pm
Posts: 11
I finally got schemaExport to work...


Here is the problem I was having...

I was creating a User table and MS SQL Server was choking with this error...

Code:
[main] ERROR net.sf.hibernate.tool.hbm2ddl.SchemaExport - Unsuccessful: create table User (id VARCHAR(27) not null, username VARCHAR(255) null, firstName VARCHAR(255) null, middleName VARCHAR(255) null, lastName VARCHAR(255) null, email VARCHAR(255) null, passwordHint VARCHAR(255) null, primary key (id))
[main] ERROR net.sf.hibernate.tool.hbm2ddl.SchemaExport - [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]Incorrect syntax near the keyword 'User'.


I couldn't figure it out until I changed the table name. Is that because 'User' is a reserved word for Microsoft SQL Server?

Thanks!
--
Nathan


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 20, 2004 7:14 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
exactly


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 20, 2004 8:10 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You can use table="`user`" to force Hibernate to use quoted identifiers.


Top
 Profile  
 
 Post subject: Thanks!
PostPosted: Wed Jul 21, 2004 10:55 am 
Newbie

Joined: Tue May 04, 2004 6:31 pm
Posts: 11
You guys are great!

Thanks a million!
--
Nathan


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