esup-helpdesk




La liste d'utilisateurs n'est pas rendue car vous ne possédez pas les droits d'accès nécessaires pour afficher les profils utilisateur.

Arborescence des pages

Comparaison des versions

Légende

  • Ces lignes ont été ajoutées. Ce mot a été ajouté.
  • Ces lignes ont été supprimées. Ce mot a été supprimé.
  • La mise en forme a été modifiée.
Commentaire: Migration of unmigrated content due to installation of a new plugin
Sommaire

Voir également :

See also: Customizing the database connection

The database connection is handled by Hibernate. The properties below (set in La connexion à la base de données est faite par Hibernate. Les propriétés ci-dessous sont définies dans le fichier /properties/config.properties et utilisées pour renseigner le fichier ) are used by the Hibernate configuration files /properties/dao/hibernate/hibernate-jdbc.cfg.xml and /properties/dao/hibernate/hibernate-jndi.

Pilote

cfg.xml, as well as the Tomcat configuration file conf/server.xml for quick-start deployments.

Avertissement
titleCreating the database

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
titleUse InnoDB with MySql

With MySql, the type of the database must be InnoDB.In order to automatically create InnoDB databases, set this property in the MySql configuration:

Bloc de code
default-table-type=innodb

Database manager properties

Driver

The driver of the database manager (by default Le pilote de la base de données (par défaut MySql JDBC):

Bloc de code
#hibernate.connection.driver_class=com.mysql.jdbc.Driver

Pour PostgreSQL For Postgres use:

Bloc de code
hibernate.connection.driver_class=org.postgresql.Driver

...

Hibernate dialect

Le dialecte The Hibernate dialect, par défaut InnoDB pour MySql by default MySql InnoDB:

Bloc de code
#hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect

Pour PostgreSQL For Postgres use:

Bloc de code
hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect

JDBC properties

esup-helpdesk always uses JDBC to access the database from ant tasks (asynchronous commands).

URL (

...

required)

L'URL de la base de données, par défaut helpdesk sur The JDBC URL of the database, by default helpdesk on localhost:

Bloc de code
#hibernate.connection.jdbc.url=jdbc:mysql://localhost/helpdesk

Pour PostgreSQL For Postgres use:

Bloc de code
hibernate.connection.jdbc.url=jdbc:postgresql://localhost:5432/helpdesk

...

Authentication (

...

required)

The credentials used to connect to the database:

Bloc de code

#hibernate.connection.jdbc.username=admin
#hibernate.connection.jdbc.password=secret

JNDI 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 propertyL'authentification à la base de données, par défaut root/(vide) :

Bloc de code
#hibernate.connection.username=root
#hibernate.connection.password=

Connecteur JDBC

hibernate.useJndi=false

To use a connection pool set like this 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" />

Tell the application the name of the pool:

Bloc de code

hibernate.useJndi=true
hibernate.connection.jndi.datasource=jdbc/esup-helpdesk

The application automatically detects its running mode (batch or web) to use JDBC (batch) or JNDI (web).

JDBC connector

esup-helpdesk is configured by default to use MySql, it embeds the MySql connector for esup-helpdesk est configuré par défaut pour utiliser MySql, embarquant notamment le connecteur MySql pour Java (mysql-connector-java.jar). Pour se connecter à un autre type de base de données que MySql, il faut :To connect to another database manager:

  • use the JDBC driver and the Hibernate dialect that corresponds to your database manager,
  • add the corresponding connector to the
  • utiliser le pilote et le dialecte Hibernate correspondant à la nouvelle base de données
  • ajouter le connecteur pour Java correspondant dans le répertoire /webapps/WEB-INF/lib
  • permettre la récupération du connecteur lors de la prochaine mise à jour (cf Conservation des personnalisations lors des mises à jour).

Voir : La documentation Hibernate

MySql

Le connecteur MySql est inclus par défaut dans la distribution.

PostgreSQL

...

See: The Hibernate documentation

MySql

The MySql connector is embedded by default in the distribution.

Postgres


  • Version 7.4:  pg74.1jdbc3.jar
  • Version 8.2: postgresql-8.2-506.jdbc3.jar

Connectors for Postgres can be downloaded from http://jdbc.postgresql.org/download.html.

Oracle

todo
Any Oracle deployer?
Any Oracle deployer?

...

Oracle

todo
A compléterA compléter