标签:
JDBC Install for OSS
1. The default JDBC/MX driver installation directory laction is
/usr/tandem/jdbcMx/T1275h50.
include:
/demo //Demo programs.
/lib/libjdbcMx.so //driver library
/lib/jdbcMx.jar //Java archive file, which includes the JDBC trace facility
/bin/jdbcMxInstall //installation script
/bin/jdbcMxUninstall //uninstall script
2. Verify the version of the JDBC/MX driver, use these commands:
Java command, which displays the version of the java code portion of the JDBC/MX driver
Vproc command, which displays the version of the C code portion of the JDBC/MX driver
To use the java command, type the following at the OSS prompt: This command displays output similar to:
java JdbcMx -version
JDBC driver for NonStop(TM) SQL/MX Version
T127H50_23DEC2005_JDBCMX...
Compare the output with the product numbers in the Softdoc file on the NonStop Server for Java 5
distribution CD.
Use the vproc command to check for the correct library. Issue the following at the OSS prompt:
vproc /jdbcmx-installation-directory/T1275H50/lib/libjdbcMx.so
...
Binder timestamp: 20DEC2005 18:10:14
Version procedure: T1275H50_23DEC2005_JDBCMX_1220
TNS/E Native Mode: runnable file
The version procedure that corresponds to the JDBC/MX Driver (T1275) product should match in the
output of both the java and vproc commands.
3. set CLASSPATH
echo $CLASSPATH
export JAVA_HOME=/usr/tandem/java
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib:/usr/tandem/jdbcMx/current/lib/jdbcMx.jar:/home/ecui/java/test/jta.jar
4. set _RLD_LIB_PATH
export _RLD_LIB_PATH=/usr/tandem/jdbcMx/T1275H50/lib
5.
Before running the JDBC application that uses BLOB and CLOB data through the JDBC API, the database administrator must create the LOB tables. or information on creating LOB tables, see Managing LOB Data with the JDBC/MX Lob Admin Utility.
6.
Before using the procedure to create the tables, note that when using MXCI to create base tables, you must enter
the following special command in the MXCI session to enable the base table creation of tables that have LOB
(BLOB or CLOB) columns:
CONTROL QUERY DEFAULT JDBC_PROCESS ‘TRUE‘
7.
To specify 200 transactions per process, use the following command.
export JAVA_PTHREAD_MAX_TRANSACTIONS=200
You cannot make procedure calls to TMF directly from any Java application. You must use either the com.tandem.tmf.Current class or the Java Transaction API (JTA) to manage transactions.
8. use the properties
java -Djdbcmx.transactionMode=external Test
mixed
Specifies that the driver inherits any active transaction in the current thread. The autocommit setting of the transaction is ignored. The application must either commit or rollback the transaction in this mode. If there is no active transaction, the driver creates one and begins the transaction, or aborts it if there is an SQL error. In this mode, the driver supports both autocommit and non-autocommit. The application ends the transaction in non-autocommit mode.
external
Specifies that if an external transaction exists, transactions are performed within the external transaction. If an external transaction does not exist, the SQL statement is executed without a transaction. This allows SQL statements that do not require an existing transaction to be performed without one, providing an improvment in performace. If an SQL command requires a transaction and no external transaction exists, an SQL exception is thrown.
internal
Specifies that transactions are always performed within a JDBC/MX driver-managed transaction. If an external transaction exists when internal transaction mode is in effect, the external transaction is suspended and the SQL statement is executed within a JDBC/MX driver-managed transaction. Upon completion of the driver’s internally managed transaction, the existing external transaction is resumed. The Connection autoCommit flag maintains a value of true when in internal transaction mode.
Follow these steps to create a base table that has LOB columns:
At the OSS prompt, invoke the SQL/MX utility MXCI. Type:
MXCI
1.
Type the following command to enable creating tables that have LOB columns:
CONTROL QUERY DEFAULT JDBC_PROCESS ‘TRUE‘
2.
Type the CREATE TABLE statement; for example, you might use the following simple form of the
statement:
CREATE TABLE table1 (c1 INTEGER NOT NULL, c2 CLOB, c3 BLOB, PRIMARY
KEY(c1))
JDBC Install for OSS
标签:
原文地址:http://www.cnblogs.com/ECNB/p/4611179.html