Hibernate main configuration file attributes,
The show_ SQL value is TRUE or FALSE.
Indicates whether to display the executed SQL statement
The value of format_ SQL is TRUE or FALSE.
Whether to format the executed SQL statement
The value of hbm2ddl indicates the following content:
Create ---- Delete first, and create the corresponding database table
Update ---- create a table if the table does not exist. update the table if the table does not exist.
Create-drop ---- create a table during initialization, and delete the table when SessionFactory executes close.
Validate ---- verify that the table structure is consistent. If the table structure is inconsistent, an exception is thrown.
Below are some common database connection configurations
MySQL
Hibernate. dialect org. hibernate. dialect. MySQLDialect
Hibernate. dialect org. hibernate. dialect. MySQLInnoDBDialect
Hibernate. dialect org. hibernate. dialect. MySQLMyISAMDialect
Hibernate. connection. driver_class com. mysql. jdbc. Driver
Hibernate. connection. url jdbc: mysql: // test
Hibernate. connection. username gavin
Hibernate. connection. password
Oracle
Hibernate. dialect org. hibernate. dialect. Oracle8iDialect
Hibernate. dialect org. hibernate. dialect. Oracle9iDialect
Hibernate. dialect org. hibernate. dialect. Oracle10gDialect
Hibernate. connection. driver_class oracle. jdbc. driver. OracleDriver
Hibernate. connection. username ora
Hibernate. connection. password ora
Hibernate. connection. url jdbc: oracle: thin: @ localhost: 1521: orcl
Hibernate. connection. url jdbc: oracle: thin: @ localhost: 1522: XE
DB2
Hibernate. dialect org. hibernate. dialect. DB2Dialect
Hibernate. connection. driver_class com. ibm. db2.jcc. DB2Driver
Hibernate. connection. driver_class COM. ibm. db2.jdbc. app. DB2Driver
Hibernate. connection. url jdbc: db2: // localhost: 50000/somename
Hibernate. connection. url jdbc: db2: somename
Hibernate. connection. username db2
Hibernate. connection. password db2