F sample jdbc configuration for hibernate, Sample jdbc – HP Integrity NonStop J-Series User Manual

Page 338

Advertising
background image

F Sample JDBC Configuration for Hibernate

This appendix describes the consolidated JDBC Type 2 driver configuration and the JDBC Type 4
driver configuration in the hibernate.cfg.xml and the hibernate.properties files.

JDBC Type 2 driver configurations
The consolidated JDBC Type 2 driver configuration in hibernate.cfg.xml is as follows:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">com.tandem.sqlmx.SQLMXDriver</property>
<property name="connection.url">jdbc:sqlmx://</property>
<property name="connection.username"></property>
<property name="connection.password"></property>
<property name="dialect">org.hibernate.dialect.SqlmxDialect</property>
<mapping resource="<Name of the .hbm file>" />
</session-factory>
</hibernate-configuration>

The SQL/MX settings for JDBC Type 2 driver in hibernate.properties appear as follows:

##---------------------------------------------------------------------
# SQL/MX Settings for JDBC Type 2 Driver
hibernate.dialect=org.hibernate.dialect.SqlmxDialect
hibernate.connection.driver_class=com.tandem.sqlmx.SQLMXDriver
hibernate.connection.url=jdbc:sqlmx://
hibernate.connection.username=
hibernate.connection.password=

JDBC Type 4 driver configurations
The consolidated JDBC Type 4 driver configuration in hibernate.cfg.xml is as follows:

<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>
<property name="connection.driver_class">com.tandem.t4jdbc.SQLMXDriver</property>
<property name="connection.url">jdbc:t4sqlmx://<HP NonStop System IP Address>:<Port No.></property>
<property name="connection.username"><HP NonStop Username></property>
<property name="connection.password"><HP NonStop Password></property>
<property name="dialect">org.hibernate.dialect.SqlmxDialect</property>
<mapping resource="<Name of the .hbm file>" />
</session-factory>
</hibernate-configuration>

The SQL/MX settings for JDBC Type 4 driver in hibernate.properties appear as follows:

#----------------------------------------------------------------------
# SQL/MX Settings for JDBC Type 4 Driver
hibernate.dialect=org.hibernate.dialect.SqlmxDialect
hibernate.connection.driver_class=com.tandem.t4jdbc.SQLMXDriver
hibernate.connection.url=jdbc:t4sqlmx://<HP NonStop System IP Address>:<Port No.>
hibernate.connection.username=<HP NonStop Username>
hibernate.connection.password=<HP NonStop Password>

338 Sample JDBC Configuration for Hibernate

Advertising
This manual is related to the following products: