-->
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: Create InnoDB by utf8 charcterset MySQL
PostPosted: Sun Jul 12, 2009 2:11 am 
Newbie

Joined: Sat Jul 11, 2009 2:46 am
Posts: 7
Hi EveryOne,
I am newbi in Hibernate :P
I wanna make Mysql table that have InnoDb type and charset utf8 but I don't know where I shoud set the setting.
I see some where said that must set (delimiter=type=InnoDB) but where? (I just have a hibernate.cfg.XMl no any .xml file for hibernate)
i dun want set mysql.ini file that default setting was InnoDB and UTF-8 I wanna put this setting in my hibernate.
TanX in advance

_________________
-*-*-*-*-*
[Am1rr3zA]


Top
 Profile  
 
 Post subject: Re: Create InnoDB by utf8 charcterset MySQL
PostPosted: Sun Jul 12, 2009 2:49 pm 
Regular
Regular

Joined: Fri Jan 30, 2009 10:10 am
Posts: 74
Location: London
Hi,

If you specify:
org.hibernate.dialect.MySQL5InnoDBDialect
as the hibernate.dialect property then Hibernate should create InnoDb type tables (presuming you are using a late enough version of MySql).

You should probably manually create the database in order to specify the charset.

--
Stephen Souness


Top
 Profile  
 
 Post subject: Re: Create InnoDB by utf8 charcterset MySQL
PostPosted: Mon Jul 13, 2009 1:40 am 
Newbie

Joined: Sat Jul 11, 2009 2:46 am
Posts: 7
Tanx man I use this before but I have Problem by hibernate.dialect.
When I use this property in hibernate.cfg.xml it's make my table InnoDB but cant Insert any Data in my table,
my code work well when i use <<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>> and i can Insert into table but when I use
< <property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>> it's create InnoDB table but didn't insert any rows!!!
should I change my code when I use (org.hibernate.dialect.MySQL5InnoDBDialect)?
Sounie wrote:
Hi,

If you specify:
org.hibernate.dialect.MySQL5InnoDBDialect
as the hibernate.dialect property then Hibernate should create InnoDb type tables (presuming you are using a late enough version of MySql).

You should probably manually create the database in order to specify the charset.

--
Stephen Souness

_________________
-*-*-*-*-*
[Am1rr3zA]


Top
 Profile  
 
 Post subject: Re: Create InnoDB by utf8 charcterset MySQL
PostPosted: Mon Jul 13, 2009 4:43 am 
Newbie

Joined: Sat Jul 11, 2009 2:46 am
Posts: 7
I also find something strange,
When I Use <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> and my code Create Table (MyISAM type) I can also insert data into table by PhpMyAdmin Or SQLYoq but when I use <property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property> it's create table InnoDB Type I can't Insert Data by phpmyadmin or SQLYoq (even My code dun Insert Rows), it's said Error Code : 1205
Lock wait timeout exceeded; try restarting transaction

when I use Transaction tx = null;
tx = session.beginTransaction();
tx.commit();
and put my code

_________________
-*-*-*-*-*
[Am1rr3zA]


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.