Defining the Hibernate Database Configuration Parameters

Hibernate can support multiple databases. You need to define database configuration parameters. The database configuration parameters are stored in the configuration file, hibernate.cfg.xml .

  1. Open the model property sheet and click the Hibernate Configuration tab:


  2. Define the type of database, JDBC driver, connection URL, JDBC driver jar file path, user name, password, etc.

Option

Description

Dialect

Specifies the dialect, and hence the type of database.

Hibert Tag: dialect

JDBC driver class

Specifies the JDBC driver class.

Hibert Tag: connection.driver_class

Connection URL

Specifies the JDBC connection URL string.

Hibert Tag: connection.url

JDBC driver jar

Specifies the JDBC driver jar file path.

Hibert Tag: N/A

User name

Specifies the database user name.

Hibert Tag: connection.username

Password

Specifies the database user password.

Hibert Tag: connection.password

Show SQL

Specifies that SQL statements should be shown in the log.

Hibert Tag: show_sql

Auto schema export

Specifies the mode of creation from tables.

Hibert Tag: hbm2ddl.auto

Package prefix

Specifies a namespace prefix for all the packages in the model.

Hibert Tag: N/A

Connection pool size

Specifies the maximum number of pooled connections.

Hibert Tag: connection.pool_size

You can verify the configuration parameters in the Preview tab.