Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

For a number of DBMS the JDBC Drivers are included with JS7. However, due to restrictions for bundling of JDBC Drivers with Open Source software for some DBMS users have to individually download the JDBC Driver from the vendor's web site:

DBMS
Product
DBMS
Version
JDBC Driver
Version
JDBC Driver
File
JDBC Driver
License
Included with JS7Comment
H2®1.4.2001.4.200h2-1.4.200.jarMPL 2.0, EPL 1.0yesDBMS and JDBC Drivers are Open Source
MariaDB®102.7.2mariadb-java-client-2.7.2.jarLGPLyesDBMS and JDBC Drivers are Open Source
MySQL®5.7, 8.08.xmysql-connector-java-8.x.jarProprietary Licenseno

DBMS is Open Source, JDBC Drivers are not Open Source

The MariaDB® JDBC Driver can be used for MySQL®

Oracle®12c, 18c, 19c19.7ojdbc8.jar
ojdbc10.jar
FUTC LicenseyesDBMS and JDBC Drivers are not Open Source
Use ojdbc10.jar for Java 10 releases and newer
PostgreSQL®10, 11, 1242.2.19postgresql-42.2.19.jarBSD 2-clauseyesDBMS and JDBC Drivers are Open Source
SQL Server®2012, 2014, 2017, 20199.xmssql-jdbc-9.x.jre8.jar
mssql-jdbc-9.x.jre11.jar
mssql-jdbc-9.x.jre15.jar
Proprietary Licenseno

DBMS and JDBC Drivers are not Open Source
Use *.jre11.jar for Java 11 - 14
Use *.jre15.jar for Java 15 and newer

Hibernate Configuration Files

...

Code Block
languagexml
titleHibernate configuration file for MariaDB® database
collapsetrue
<?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:mysqlmariadb://mariadbsrv:3306/jobscheduler</property>
  <property name="hibernate.connection.username">jobscheduler</property>
  <property name="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect<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.hikari.maximumPoolSize">10</property>
 </session-factory>
</hibernate-configuration>

...

  • The example makes use of the SQL Server® database server running for hostname sqlserversrv and port 1433.
  • Consider that use of the above parameters with the JDBC URL is required: sendStringParametersAsUnicode=false;selectMethod=cursor

Connection Pool

JS7 makes use of a connection pool to allow a larger number of JOC Cockpit user sessions to share database connections form the pool.

  • By default JOC Cockpit is configured to use up to 10  connections from the pool. As a rule of thumb 1 connection can be shared by approx. 3 parallel users.
  • Adjust this setting to the max. number of connections required for sharing between parallel users of JOC Cockpit. 

Hibernate offers to choose one out of a number of Connection Pool implementations.

  • By default the Hikari Connection Pool is used with JS7.
    • The Hikari setting for the maximumPoolSize

      should be

      is included with

      a

      the Hibernate configuration file as this determines the max. number of open database connections

      . Adjust this setting to the number of connections required for sharing between parallel users of JOC Cockpit. As a rule of thumb 10 connections should work for approx .30 parallel users.

      :

      Code Block
      languagexml
      titleHikari Connection Pool recommended settings
      collapsetrue
        <property name="hibernate.hikari.maximumPoolSize">10</property>
      



    • Additional Any additional settings for Hikari can be added by property elements to a Hibernate configuration file.
  • Alternatively e.g. the C3P0 Connection Pool can be used.
    • Use of C3P0 suggests a number of additional settings that better match use with JS7 than the default values

      Code Block
      languagexml
      titleC3P0 Connection Pool recommended settings
      collapsetrue
        <property name="hibernate.connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
        <property name="hibernate.c3p0.maxConnectionAge">14400</property>
        <property name="hibernate.c3p0.maxStatementsPerConnection">0</property>
        <property name="hibernate.c3p0.maxStatements">0</property>
        <property name="hibernate.c3p0.checkoutTimeout">0</property>
        <property name="hibernate.c3p0.maxIdleTime">14400</property>
        <property name="hibernate.c3p0.acquireRetryAttempts">1</property>
        <property name="hibernate.c3p0.minPoolSize">5</property>
        <property name="hibernate.c3p0.acquireIncrement">1</property>
        <property name="hibernate.c3p0.statementCacheNumDeferredCloseThreads">1</property>
        <property name="hibernate.c3p0.numHelperThreads">3</property>
        <property name="hibernate.c3p0.idleConnectionTestPeriod">1800</property>
        <property name="hibernate.c3p0.maxPoolSize">10</property>
        <property name="hibernate.c3p0.initialPoolSize">5</property>
    • Additional settings can be added by corresponding property elements, however, close reading of the C3P0 docs is recommended before applying changes.