Page History
...
- JOC Cockpit makes use of a database to store inventory information, status information and workflow related logs. The database is required for restarting capabilities with the JS7 - Cluster Service.
- JS7 does not include a DBMS, instead, it make use of a DBMS that has been installed separately - with the exception of H2® for which JS7 includes an embedded version of the DBMS that ships for evaluation purposes.
- The supported DBMS products include
- Embedded H2®
- MariaDB®
- MySQL®
- Oracle®
- PostgreSQL®
- SQL Server®
- Basically any versions of a DBMS can be used that are actively supported by its vendor.
- Access to the DBMS is provided by the Hibernate database access layer. This includes to use a JDBC Driver that is specific for the DBMS.
- Consider to check and to apply measures for JS7 - Database Maintenance
...
- Hibernate configuration files are used from an XML format.
- JS7 - JOC Cockpit Installation On Premises
- During installation the respective hibernate configuration file is created and can be manually updated later on.
- After installation of JOC Cockpit the
hibernate.cfg.xml
Hibernate configuration file is available in- Unix
/var/sos-berlin.com/js7/joc/jetty_base/resources/joc
- Windows
C:\ProgramData\sos-berlin.com\js7\joc\jetty_base\resources\joc
- A different location for the configuration directory can be specified during installation of JOC Cockpit.
- Unix
- By default the Hikari Connection Pool is used.
Hibernate Configuration for H2®
- JS7 - JOC Cockpit Installation for Docker Containers
- JOC Cockpit ships preinstalled from a Docker® image.
- It is therefore recommended to download/copy one of the below Hibernate configuration files to
/var/sos-berlin.com/js7/joc/jetty_base/resources/joc
- Adjust changes to reflect your database connection. For use with H2® you can use the below sample without changes.
- By default the Hikari Connection Pool is used.
Hibernate Configuration for Embedded H2®
Download: hibernate.cfg.xml-h2 (drop the -h2
extension when storing the file)
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Code Block | ||||||
| ||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">org.h2.Driver</property> <property name="hibernate.connection.password">jobscheduler</property>> <property name="hibernate.connection.url">jdbc:h2:./resources/varjoc/h2/jobscheduler<joc</property> <property name="hibernate.connection.username">jobscheduler<>joc</property> <property name="hibernate.dialect">org.hibernate.dialect.H2Dialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> <property name="hibernate.connection.provider_class">org.hibernate.hikaricp.internal.HikariCPConnectionProvider</property> <property name="hibernate.hikari.maximumPoolSize">10</property> </session-factory> </hibernate-configuration> |
Explanation:
- The JDBC connection URL in this sample makes use of an the embedded H2® database server. The database file is located in
/var/h2/jobscheduler
. database server. The database file is located in/var/sos-berlin.com/js7/joc/resources/joc/h2.
- You can store the above configuration without further changes to the
/var/sos-berlin.com/js7/joc/jetty_base/resources/joc
directory. - Note: for For use with a standalone H2® database server use a syntax such as
jdbc:h2:tcp://<host>:<port>/jobscheduler
where<host>
is the hostname and<port>
is the H2® database port (frequently:1521
).
...
- is the H2® database port (frequently:
1521
).
Hibernate Configuration for MariaDB®
Download: hibernate.cfg.xml-mariadb (drop the -mariadb
extension when storing the file)
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">org.mariadb.jdbc.Driver</property> <property name="hibernate.connection.password">jobscheduler</property> <property name="hibernate.connection.url">jdbc:mariadb://mariadbsrv:3306/jobscheduler</property> <property name="hibernate.connection.username">jobscheduler</property> <property name="hibernate.dialect">org.hibernate.dialect.MariaDBDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> <property name="hibernate.connection.provider_class">org.hibernate.hikaricp.internal.HikariCPConnectionProvider</property> <property name="hibernate.hikari.maximumPoolSize">10</property> </session-factory> </hibernate-configuration> |
...
Hibernate Configuration for MySQL®
Download: hibernate.cfg.xml-mysql (drop the -mysql
extension when storing the file)
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">org.mysql.jdbc.Driver</property> <property name="hibernate.connection.password">jobscheduler</property> <property name="hibernate.connection.url">jdbc:mysql://mysqlsrv:3306/jobscheduler</property> <property name="hibernate.connection.username">jobscheduler</property> <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> <property name="hibernate.connection.provider_class">org.hibernate.hikaricp.internal.HikariCPConnectionProvider</property> <property name="hibernate.hikari.maximumPoolSize">10</property> </session-factory> </hibernate-configuration> |
...
- The example makes use of the MySQL® database server running for hostname
mysqlsrv
and port3306
.
Hibernate Configuration for Oracle®Configuration for Oracle®
Download: hibernate.cfg.xml-oracle (drop the -oracle
extension when storing the file)
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">oracle.jdbc.OracleDriver</property> <property name="hibernate.connection.password">jobscheduler</property> <property name="hibernate.connection.url">jdbc:oracle:thin:@//oraclesrv:1521/xe</property> <property name="hibernate.connection.username">jobscheduler</property> <property name="hibernate.dialect">org.hibernate.dialect.Oracle12cDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> <property name="hibernate.connection.provider_class">org.hibernate.hikaricp.internal.HikariCPConnectionProvider</property> <property name="hibernate.hikari.maximumPoolSize">10</property> </session-factory> </hibernate-configuration> |
...
Hibernate Configuration for PostgreSQL®
Download: hibernate.cfg.xml-postgresql (drop the -postgresql
extension when storing the file)
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">org.postgresql.Driver</property> <property name="hibernate.connection.password">jobscheduler</property> <property name="hibernate.connection.url">jdbc:postgresql://postgresqlsrv:5432/jobscheduler</property> <property name="hibernate.connection.username">jobscheduler</property> <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> <property name="hibernate.connection.provider_class">org.hibernate.hikaricp.internal.HikariCPConnectionProvider</property> <property name="hibernate.hikari.maximumPoolSize">10</property> </session-factory> </hibernate-configuration> |
...
Hibernate Configuration SQL Server®
Download: hibernate.cfg.xml-sqlserver (drop the -sqlserver
extension when storing the file)
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <hibernate-configuration> <session-factory> <property name="hibernate.connection.driver_class">com.microsoft.sqlserver.jdbc.SQLServerDriver</property> <property name="hibernate.connection.password">jobscheduler</property> <property name="hibernate.connection.url">jdbc:sqlserver://sqlserversrv:1433;sendStringParametersAsUnicode=false;selectMethod=cursor;databaseName=jobscheduler</property> <property name="hibernate.connection.username">jobscheduler</property> <property name="hibernate.dialect">org.hibernate.dialect.SQLServer2005Dialect</property> <property name="hibernate.show_sql">false</property> <property name="hibernate.connection.autocommit">false</property> <property name="hibernate.format_sql">true</property> <property name="hibernate.temp.use_jdbc_metadata_defaults">false</property> <property name="hibernate.connection.provider_class">org.hibernate.hikaricp.internal.HikariCPConnectionProvider</property> <property name="hibernate.hikari.maximumPoolSize">10</property> </session-factory> </hibernate-configuration> |
...
When installing or updating JOC Cockpit then you can specify the JDBC Driver that should be used by the installer, for details see
- JS7 - JOC Cockpit - Use of Headless Installation on Linux/Windows Headless Installation
- JS7 - JOC Cockpit - Use of Installation Using the Linux/Windows Graphical Installer
The following chapters explain how to add a JDBC Driver to an existing installation without updating JOC Cockpit from the installer.
...