Running employeeinfo on nonstop – HP Integrity NonStop J-Series User Manual

Page 220

Advertising
background image

3.

Set the value of the JDBC driver locations.

1.

To use the JDBC Type 2 driver, set the value of the t2jdbc variable to the <JDBC
T2 Installation Directory
>

OSS directory.

For example, if <JDBC T2 Installation Directory> is /usr/tandem/
jdbcMx/current

, the t2jdbc variable must be set to t2jdbc=/usr/tandem/

jdbcMx/current.

2.

To use the JDBC Type 4 driver:

Copy the JDBC Type 4 driver JAR file, t4sqlmx.jar, from <JDBC T4
Installation Directory
>\lib

the Windows directory to an OSS directory

on the NonStop system.

Replace <NonStop T4 Location> with the absolute path of the OSS directory
where you have kept the t4sqlmx.jar file.

For example, if <NonStop T4 Location> is /home/sash_usr/sash/
jdbct4

, the t4jdbc variable must be set to t4jdbc=/home/sash_usr/

sash/jdbct4

.

NOTE:

To view the contents of the ei_setenv script file, see

“Hibernate

Environment Setup Script” (page 228)

.

3.

Set the execute permissions of the ei_setenv script file using the OSS command:

OSS> chmod +x ei_setenv

5.

Run the ei_setenv script file to set the JDBC environment and include the dependency JAR
files in the CLASSPATH.

To use the JDBC Type 2 driver, type:

OSS> . ./ei_setenv T2

To use the JDBC Type 4 driver, type:

OSS> . ./ei_setenv T4

Running EmployeeInfo on NonStop

To run the EmployeeInfo on NonStop systems, complete the following steps:
1.

Go to the <NonStop SASH Home>/hibernate/my_samples/employeeinfo directory
on the NonStop system.

2.

Un-JAR the contents of the application JAR file EmployeeInfo.jar:

OSS> jar -xvf EmployeeInfo.jar

3.

Run the EmployeeInfo application:

OSS> java com.hp.imp.Test

The following output appears:

Hibernate: select max(id) from Emp
Hibernate: insert into Emp (fname, lname, age, id) values (?, ?, ?, ?)
1237276999876
Hibernate: select employee0_.id as id0_, employee0_.fname as fname0_, employee0_
.lname as lname0_, employee0_.age as age0_ from Emp employee0_
----------1
----------Test
Employee found using HQL
o_id=1

220 Getting Started with Hibernate

Advertising
This manual is related to the following products: