Versions Compared

Key

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

...

Code Block
languagexml
titleHibernate configuration file for SQL Server® database
collapsetrue
<?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.hikari.maximumPoolSize">10</property>
 </session-factory>
</hibernate-configuration>

Explanations:

  • Consider that the JDBC Driver for SQL Server® has to be downloaded individually as it does not ship with JS7.
  • 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
  • For Windows environments access to SQL Server can be configured to use integrated security, i.e. to use the account that the JOC Cockpit Windows Service is operated for. 
    • Specify empty values for the <property name="hibernate.connection.username"> and <property name="hibernate.connection.password"> elements.
    • Add to the JDBC URL: integratedSecurity=true
    • The account used for the JOC Cockpit Windows Service has to be configured with SQL Server® to allow access to the database.
    • The JDBC Driver distribution usually ships with a library for authentication purposes with a name such as sql_jdbc.dll or  mssql-jdbc_auth-9.2.1.x64.dll or similar. This library should be added to a location that is specified with the Windows PATH environment variable for the JOC Cockpit Windows Service or simply put into the C:\Windows\System32 directory or bin directory of the Java JDK/JRE in use.

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.

...