-->
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: doubt on Dialect
PostPosted: Mon Oct 12, 2009 8:33 am 
Newbie

Joined: Fri Oct 09, 2009 7:59 am
Posts: 4
Hi

I have one doubt.
"Dialect" is tells to hibernate which database we are using.
The same job is done by particular database Driver.
Example:

org.hibernate.dialect.MySQLDialect: it means we are using mysql database.
com.mysql.jdbc.Driver:This driver telling same.

Why we are using Dialect and Driver.

Please any body answer this question.

regards
Srinivas.d


Top
 Profile  
 
 Post subject: Re: doubt on Dialect
PostPosted: Mon Oct 12, 2009 9:14 am 
Senior
Senior

Joined: Tue Oct 28, 2008 10:39 am
Posts: 196
No. Dialect tells Hibernate which dialect to use while driver names the driver. Driver is needed for the JDBC-connection - sometimes there is more than one driver for a database product. Dialect is used to tell Hibernate about some specific SQL. What if there is a new function in a new version our your database but you can use the same driver?


Top
 Profile  
 
 Post subject: Re: doubt on Dialect
PostPosted: Mon Oct 12, 2009 10:59 am 
Beginner
Beginner

Joined: Wed Apr 18, 2007 6:17 pm
Posts: 49
Location: Dominican Republic
The dialect in hibernate refers to the SQL customizations or syntax that each particular database has to perform an operation, you
can also think as a set of grammar and syntax that it's used by hibernate to generate a valid SQL sentence for the db associated with
that dialect. Hibernate have one dialect for each mayor database vendor. Another distinction it's that the driver it's made by the vendor while the dialect it's made
by the hibernate team.

Regards


Top
 Profile  
 
 Post subject: Re: doubt on Dialect
PostPosted: Tue Oct 13, 2009 4:06 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
all true, additionally you don't need to define the Dialect as it defaults to an appropriate one depending on the driver ;-)
Still it might be useful to declare the Dialect you want to override/fix the automagical selection.

_________________
Sanne
http://in.relation.to/


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.