Historique de la page
| Sommaire |
|---|
See also: Personnalisation de la connexion à la base de données Customizing the database connection
The database connection is handled by Hibernate. The properties below (set in /properties/config.properties) are used by the Hibernate configuration files /properties/dao/hibernate/hibernate-jdbc.cfg.xml and /properties/dao/hibernate/hibernate-jndi.cfg.xml, as well as the Tomcat configuration file conf/server.xml for quick-start deployments.
| Avertissement | ||
|---|---|---|
| ||
esup-helpdesk, when running the ant task init-data, creates all the structures (tables) of the database, but the database must exist. It is up to the deployer to create the database and make sure that the database user declared can create structures (tables, fields) and has read/write access to the database. |
| Remarque | ||
|---|---|---|
| ||
With MySql, the type of the database must be InnoDB.In order to automatically create InnoDB databases, set this property in the MySql configuration:
|
Database manager properties
...
esup-helpdesk can use JNDI to access the database from web requests. Using JNDI is recommended in production for performance reasons, it allows deployers to monitor the database load thanks to tools such as LambdaProbe (see 25 Surveillance des applications).
To use JDBC to access the database even from web requests, set this property:
...
To use a connection pool set like this ion on Tomcat in the application context,
| Bloc de code |
|---|
<Resource name="jdbc/esup-helpdesk" auth="Container" type="javax.sql.DataSource" username="admin" password="secret" driverClassName="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost/rennes1-20080905?autoReconnect=true" maxActive="100" maxIdle="10" maxWait="10000" poolPreparedStatements="true" validationQuery="SELECT 1" removeAbandoned="true" removeAbandonedTimeout="60" logAbandoned="true" /> |
...
- use the JDBC driver and the Hibernate dialect that corresponds to your database manager,
- add the corresponding connector to the /webapps/WEB-INF/lib folder*,*
- allow the automatic recovering of this file when upgrading (see Conservation des personnalisations lors des mises à jour Recovering previous configuration and customizations when upgrading).
See: The Hibernate documentation
...