C.1. Getting Fluent in the Local SQL
Hibernate ships with detailed support for many commercial and free relational databases. While most features will work properly without doing so, it's important to set the hibernate.dialect configuration property to the right subclass of net.sf.hibernate.dialect.Dialect, especially if you want to use features like native or sequence primary key generation or session locking. Choosing a dialect is also a very convenient way of setting up a whole raft of Hibernate configuration parameters you'd otherwise have to deal with individually.
Database system | Appropriate hibernate.dialect setting |
---|---|
DB2 | net.sf.hibernate.dialect.DB2Dialect |
FrontBase | net.sf.hibernate.dialect.FrontbaseDialect |
HSQLDB | net.sf.hibernate.dialect.HSQLDialect |
Informix | net.sf.hibernate.dialect.InformixDialect |
Ingres | net.sf.hibernate.dialect.IngresDialect |
Interbase | net.sf.hibernate.dialect.InterbaseDialect |
Mckoi SQL | net.sf.hibernate.dialect.MckoiDialect |
Microsoft SQL Server | net.sf.hibernate.dialect.SQLServerDialect |
MySQL | net.sf.hibernate.dialect.MySQLDialect |
Oracle (any version) | net.sf.hibernate.dialect.OracleDialect |
Oracle 9 (specifically) | net.sf.hibernate.dialect.Oracle9Dialect |
Pointbase | net.sf.hibernate.dialect.PointbaseDialect |
PostgreSQL | net.sf.hibernate.dialect.PostgreSQLDialect |
Progress | net.sf.hibernate.dialect.ProgressDialect |
SAP DB | net.sf.hibernate.dialect.SAPDBDialect |
Sybase | net.sf.hibernate.dialect.SybaseDialect |
Sybase Anywhere | net.sf.hibernate.dialect.SybaseAnywhereDialect |
If you don't see your target database ...
Get Hibernate: A Developer's Notebook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.