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.  [ 1 post ] 
Author Message
 Post subject: Problem when creating tables using MySql
PostPosted: Thu Jul 19, 2007 7:19 am 
Newbie

Joined: Thu Jul 19, 2007 6:16 am
Posts: 1
Hello.

I have been using Nhibernate together with MS Access, but I am now changing to MySql 5.0.
In my XML file I now have

Code:
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="dialect">NHibernate.Dialect.MySQL5Dialect</property>
<property name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</property>
<property name="connection.connection_string">Server=localhost;Database=moon;User id=root;Password=pass;CharSet=latin1;</property>


I would like Nhibernate to create any nessesary tables. With the MS Access configuration I used

Code:
<property name="hibernate.hbm2ddl.auto">create</property>


But for some reason an error occurs when trying to build the session factory, the error:

Code:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Lines INTEGER, LineSamples INTEGER, HorPixScale DOUBLE, VerPixScale DOUBLE, PDSF' at line 1


If I leave out the hibernate.hbm2ddl.auto property the program starts, but when trying to fill in data I get an error like this:
Code:
could not insert: ...

No tables are created either.

The problem might be somthing with the dialect or charset, the DB is using latin1.
Does anyone now how to solve this?
Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.