Dialect tells us the complete information of relational databse which is returning metadata by the JdbcDreiver.
this property use to map data base according to the driver which we are using in application
for example if u are using Oracle data base then u need to mention the bellow dialect Oracle (any version) - org.hibernate.dialect.OracleDialect
Like this so many dialect provided by the hibernate according to ur required databse For Example:
DB2 - org.hibernate.dialect.DB2Dialect
HypersonicSQL - org.hibernate.dialect.HSQLDialect
Informix - org.hibernate.dialect.InformixDialect
Ingres - org.hibernate.dialect.IngresDialect
Interbase - org.hibernate.dialect.InterbaseDialect
Pointbase - org.hibernate.dialect.PointbaseDialect
PostgreSQL - org.hibernate.dialect.PostgreSQLDialect
Mckoi SQL - org.hibernate.dialect.MckoiDialect
Microsoft SQL Server - org.hibernate.dialect.SQLServerDialect
MySQL - org.hibernate.dialect.MySQLDialect
Oracle (any version) - org.hibernate.dialect.OracleDialect
Oracle 9 - org.hibernate.dialect.Oracle9Dialect
Progress - org.hibernate.dialect.ProgressDialect
FrontBase - org.hibernate.dialect.FrontbaseDialect
SAP DB - org.hibernate.dialect.SAPDBDialect
Sybase - org.hibernate.dialect.SybaseDialect
Basicaly it depends upon which dfriver u are using according to driver you need to mention dialect property
there are hundreds of propertys which u have to configure..
But normal programmer will try to configure upto 10 property's only..
So by mentioning the dialect we are informing the hibernate system to choose the remaining property's sensibily(intelligently) for our application to be running smoothly..
This is one of the reason which we have to mention dialect..
And one more reason is every database can understand only one lang that is sql..
While talking with the database there will be some issues like datatypes which will differ from database to dataase .
Though every database knows sql language if u prepare one sql statement for oracle and if u try to execute in mysql..it may or maynot work because some issues will be concerned there like datatypes..
So by mentioning the dialect the hibernate could understand which database sql query it wants to prepare intelligently..
One thing u have to understand is the dialect names were not given by database vendors..
These dialect names were given by hibernate itself for making the user to select one of the dialect names..
--> Dialects are used for converting java methods into appropriate sql queries.
--> and the main reason is data types are different from one data base to another data base.
--> for ex:varchar2 is only the data type in oracle.it will not work in other data bases.
dialect is a special class supporting by hibernate.Dialect class is seperate for every databese.for example for oracle database ,we use OracleDialect class and for mysql database ,we use MysqlDatabase.
In hibernate ,we no need to create sql queries.hibernate will generate the quries.to generate the sql quries related to database,hibernate uses dialect class,which internally take care of generating the sql quries related to database.