Versions Compared

Key

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

...

  • <property name="hibernate.connection.username">cs://@user</property> 
  • <property name="hibernate.connection.password">cs://@password</property> 
  • <property name="hibernate.connection.url">cs://@url</property>     

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Save the custom hibernate.cfg.xml file on any location and assign the path of the hibernate file in the job parameter. 


Example of a hibernate file that uses KeePass for database (kdbx) with Password to access database credentialcredentials.

Code Block
languagexml
titleExample
collapsetrue
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<hibernate-configuration>
<session-factory>
<property name="hibernate.connection.url"><![CDATA[cs://server/test/reporting/MySQL@url?file=config/cs/kdbx-p-f.kdbx&password=test]]></property>
<property name="hibernate.connection.username"><![CDATA[cs://server/prod/reporting/MySQL@username?file=config/cs/kdbx-p-f.kdbx&password=test]]></property>
<property name="hibernate.connection.password"><![CDATA[cs://server/test/reporting/MySQL@password?file=config/cs/kdbx-p-f.kdbx&password=test]]></property>

<property name="hibernate.connection.driver_class">org.mariadb.jdbc.Driver</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>
</session-factory>
</hibernate-configuration>

...

  • Hibernate file make use of kdbx KeePass database (kdbx) for accessing Database credentialcredentials
  • cs://server/test/reporting/MySQL is the <entry_path> of path where the kdbx database of KeePass Credential StoreMySQL database credential stores.
  • file - File path of kdbx keePass databasethe KeePass database (kdbx).
  • password- Password for accessing kdbx database where credentials storethe KeePass database (kdbx)


Example of a hibernate file with a key file for the credential store database file.   that uses the KeePass database (kdbx) with a key file (same name as of the kdbx but with extension .key) to access database credentials.

Code Block
languagexml
titleExample
collapsetrue
<?xml version="1.0" encoding="UTF-8" standalone="no"?> 
<hibernate-configuration> 
<session-factory> 
<property name<property name="hibernate.connection.url"><![CDATA[cs:///kdbx-p-fserver/test/reporting/MySQL@url?file=./config/livecs/keepass/kdbx-p-f.kdbx]]></property> property>
<property name<property name="hibernate.connection.username"><![CDATA[cs://server/prod/kdbx-p-freporting/MySQL@username?file=./config/live/keepasscs/kdbx-p-f.kdbx]]></property> property>
<property name<property name="hibernate.connection.password"><![CDATA[cs://kdbx-p-f/server/test/reporting/MySQL@password?file=./config/livecs/keepass/kdbx-p-f.kdbx]]></property> property>
<property name="hibernate.connection.driver_class">org.mariadb.jdbc.Driver</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> 
</session-factory> 
</hibernate-configuration> 

...

  • Hibernate file make use of KeePass database (kdbx) with Key File Authentication for accessing Database credentialcredentials
  • cs://server/test/reporting/MySQL is the <entry_path> path where the MySQL database credential stores.
  • file- File path where the KeePass database (kdbx)
  • If the key file name and KeePass database (kdbx) file name are the same and are at the same location, for example, KeePass database name is kdbx-p-f.kdbx and the key file name is kdbx-p-f.key and both are on the same path i.e. config/cs then it will take the key default and it is not required to mention the file path where to the kdbx key file stores.

Downloads

...