Contents HP JDBC Driver for SQL/MX Programmer's Reference Abstract This document describes how to use the JDBC Driver for SQL/MX (JDBC/MX), a type 2 driver, on HP Integrity NonStop™ servers. JDBC/MX provides HP NonStop Server for Java applications with JDBC access to HP NonStop SQL/MX. JDBC/MX driver conforms where applicable to the standard JDBC 3.0 API from Sun Microsystems, Inc.
529777-001 JDBC Driver for SQL/MX (JDBC/MX) H10 and V32 May 2005 Document Disclaimer Information contained in a manual is subject to change without notice. Please check with your authorized HP NonStop systems representative to make sure you have the most recent information.
© 1987, 1988, 1989 Carnegie-Mellon University. © 1989, 1990, 1991 Digital Equipment Corporation. © 1985, 1988, 1989, 1990 Encore Computer Corporation. © 1988 Free Software Foundation, Inc. © 1987, 1988, 1989, 1990, 1991 Hewlett-Packard Company. © 1985, 1987, 1988, 1989, 1990, 1991, 1992 International Business Machines Corporation. © 1988, 1989 Massachusetts Institute of Technology. © 1988, 1989, 1990 Mentat Inc. © 1988 Microsoft Corporation. © 1987, 1988, 1989, 1990, 1991, 1992 SecureWare, Inc.
CONSTRUED AS CONSTITUTING AN ADDITIONAL WARRANTY. Contents HP JDBC Driver for SQL/MX Programmer's Reference (529777-001) © 2005 Hewlett-Packard Development Company L.P. All rights reserved.
Home JDBC Driver for SQL/MX Programmer's Reference Contents ● ● ● About This Document ❍ New and Changed Information ❍ Is This Document for You? ❍ Document Structure ❍ Printing This Document ❍ Related Reading ■ NonStop System Computing Documents ■ Sun Microsystems Documents ❍ Notation Conventions ❍ Abbreviations Introduction to JDBC/MX Driver ❍ JDBC/MX Architecture ❍ JDBC API Packages ❍ Sample Programs Installing and Verifying JDBC/MX ❍ Installation Requirements ❍ JDBC/MX Driver
● ❍ Verifying the JDBC/MX Driver ❍ Setting CLASSPATH Accessing SQL Databases with SQL/MX ❍ ❍ ❍ Connection to SQL/MX ■ Connection Using the DriverManager Class ■ Connection Using the DataSource Implementation JDBC/MX Properties ■ Default Catalog and Schema ■ LOB Table Name Properties ■ ISO88591 Property ■ mploc Property ■ maxStatements Property ■ minPoolSize Property ■ maxPoolSize Property ■ transactionModeProperty ■ Setting Properties in the Command Line Transactions ■ Autocom
❍ ● ■ Setting Batch Processing for Prepared Statements ■ Setting the reserveDataLocators Property Supported Character Set Encodings Working with BLOB and CLOB Data ❍ Architecture for LOB Support ❍ Setting Properties for the LOB Table ❍ ❍ ❍ ■ Specifying the LOB Table ■ Reserving Data Locators Storing CLOB Data ■ Inserting CLOB Columns by Using the Clob Interface ■ Writing ASCII or Unicode Data to a CLOB Column ■ Inserting CLOB Data by Using the PreparedStatement Interface ■ Inserting
❍ ● Managing the SQL/MX Tables for BLOB and CLOB Data ❍ ❍ ● Creating Base Tables that Have LOB Columns ■ Data Types for LOB Columns ■ Using MXCI to Create Base Tables that Have LOB Columns ■ Using JDBC Programs to Create Base Tables that Have LOB Columns Managing LOB Data by Using the JDBC/MX Lob Admin Utility ■ Running the JDBC/MX Lob Admin Utility ■ Help Listing from the JDBC/MX Lob Admin Utility ❍ Using SQL/MX Triggers to Delete LOB Data ❍ Limitations of the CLOB and BLOB Data Types JD
● ● ● ❍ Tracing by Loading the Trace Driver Within the Program ❍ Tracing Using a Wrapper Data Source ❍ Enabling Tracing for Application Servers ❍ Output Format ❍ JDBC Trace Facility Demonstration Program Migration ❍ Transactions ❍ nametype Property ❍ Deprecated Property-Name Specification ❍ Row Count Array of the PreparedStatement.
Home | Contents | Prev | Next | Index | Glossary | Prev | Next About This Document This section explains these subjects: ● New and Changed Information ● Is This Document for You? ● Document Structure ● Printing This Document ● Related Reading ● Notation Conventions ● Abbreviations New and Changed Information This edition (part number 529777-001) of the HP JDBC Driver for SQL/MX Programmer's Reference is an update to the manual about using the JDBC/MX V32 driver.
❍ A limitation was added on the names of base tables that have CLOB or BLOB columns as described under Limitations of the CLOB and BLOB Data Types. ❍ The CHAR data type is now supported by the java.sql.PreparedStatement.setBytes(int ColumnIndex, bytes[] x) method and java.sql.ResultSet.getBytes(int ColumnIndex) method. Added the following methods as deviating from the standard API: java.sql.ResultSetMetaData.getPrecision(int column) java.sql.ResultSetMetaData.
Introduction to JDBC Driver for SQL/MX Describes the JDBC/MX driver architecture and the API package. Installing and Verifying JDBC/MX Describes where to find information about the installation requirements and explains how to verify the JDBC/MX driver the installation. Accessing SQL Databases with SQL/MX Explains how to access SQL databases with SQL/MX from the NonStop Server for Java 4 by using the JDBC/MX driver.
Related Reading For background information about the features described in this guide, see the following documents: ● HP NonStop JDBC Driver for SQL/MX API Reference (javadoc information about the JDBC/MX APIs available in the NonStop Technical Library) ● NonStop System Computing Documents ● Sun Microsystems Documents NonStop System Computing Documents The following NonStop system computing documents are available in the NonStop Technical Library. ● ● Additional Java-Oriented Products.
● ❍ databases with SQL/MX. SQL/MX Guide to Stored Procedures in Java ❍ Describes how to develop and deploy stored procedures in Java (SPJs) in SQL/MX. SQL/MX Quick Start ❍ Describes basic techniques for using SQL in the SQL/MX conversational interface (MXCI). Also includes information about installing the sample database. SQL/MX Comparison Guide for SQL/MP Users ❍ Compares SQL/MP and SQL/MX. SQL/MX Installation and Management Guide ❍ Describes how to install and manage SQL/MX on a NonStop server.
documentation in the JDBC Driver for SQL/MX documentation go to the Sun Microsystems web sites, which provide more extensive documentation than SDK 1.4.2. HP cannot guarantee the availability of the J2SE SDK 1.4.2 documentation on the Sun web sites. Also, HP is not responsible for the links or content in the documentation from Sun Microsystems. ● ● ● ● ● JDBC 3.0 Specification, available for downloading from Sun Microsystems (http://java.sun.com/products/jdbc/download.html).
sequence of syntax items any number of times. For example: print {objectID|objectName} ... An ellipsis immediately following a single syntax item indicates that you can repeat that syntax item any number of times. For example: dump objectID ... Punctuation Parentheses, commas, equal signs, and other symbols not previously described must be entered as shown.
JCK. Java Conformance Kit JFC. Java Foundation Classes JDBC. Java Database Connectivity JDBC/MP. JDBC Driver for SQL/MP JDBC/MX. JDBC Driver for SQL/MX JNDI. Java Naming and Directory Interface JNI. Java Native Interface JRE. Java Run-time Environment LAN. local area network LOB. Large OBject MBCS. Multibyte Character Set NonStop TS/MP. NonStop Transaction Services/MP OSS. Open System Services POSIX. portable operating system interface x RISC. reduced instruction set computing RVU.
Home | Contents | Prev | Next | Index | Glossary | Prev | Next Introduction to JDBC/MX Driver The HP JDBC Driver for SQL/MX (JDBC/MX) implements the JDBC technology that conforms to the standard JDBC 3.0 Data Access API. This JDBC/MX driver enables Java applications to use HP NonStop SQL/MX to access NonStop SQL databases. For more information on the JDBC APIs associated with the JDBC/MX implementation, see Sun Microsystems Documents earlier in this document.
The following figure illustrates a three-tier architecture for database access: Architecture of the JDBC Driver for SQL/MX JDBC API Packages The JDBC/MX API packages are shipped with the JDBC Driver for SQL/MX software. For the API documentation, see the JDBC/MX 3.2 driver documentation in the NonStop Technical Library. The java.sql and javax.sql packages are included as part of Java 2, Standard Edition (J2SE) SDK 1.4.
Sample Programs Summary JDBC Driver for SQL/MX includes sample Java programs that illustrate the features of the product. The programs are described in the following table. Sample Program Comments sampleJdbcMx.java Illustrates loading the JDBC for NonStop(TM) SQL/MX driver and obtaining a JDBC connection using the DriverManager interface. CreateDataSource.java and TestDataSource.
TestConnectionPool.java Demonstrates the benefits of connection pooling and statement pooling. This program performs a loop for a 100 times that makes a JDBC connection, runs a few SQL statements, and closes the connection. You use the OSS time() command to measure the performance benefits of connection pooling and statement pooling in this program. CreateTraceDS.java TestTraceDS.java Demonstrates tracing by creating a wrapper around the driver-specific data source to be traced.
Home | Contents | Prev | Next | Index | Glossary | Prev | Next Installing and Verifying JDBC/MX This section explains these subjects: ● Installation Requirements ● JDBC/MX Driver File Locations ● Verifying the JDBC/MX Driver ● Setting CLASSPATH Installation Requirements Hardware and software requirements for the JDBC Driver for SQL/MX are described in the Softdoc file on the NonStop Server for Java 4 product CD, with which JDBC/MX is delivered. Read that document before installing the product.
JDBC/MX Driver File Locations The JDBC/MX driver installation directory location for the JDBC/MX driver software is: ● On TNS/E, install_dir/jdbcMx/T1275H10 ● On TNS/R, install_dir/jdbcMx/T1225V32 For example, the default installation directory is /usr/tandem/jdbcMx/T1225V32 The files installed include: .../demo Demo programs .../lib/libjdbcMx.lib JDBC/MX driver library .../lib/jdbcMx.jar JDBC/MX Java archive file, which includes the JDBC trace facility .../bin/jdbcMxInstall JDBC/MX installation script ...
JDBC driver for NonStop(TM) SQL/MX Version T1225V32_08APR2005_JDBCMX... Compare the output with the product numbers in the Softdoc file on the NonStop Server for Java 4 distribution CD. Use the vproc command to check for the correct library. Issue the following at the OSS prompt: For TNS/E vproc /jdbcmx-installation-directory/T1275H10/lib/libjdbcMx.so For TNS/R vproc usr/tandem/java_public_lib_jdk142/libjdbcMx.lib The vproc command displays output similar to: GMT Binder timestamp: ...
Setting CLASSPATH For running JDBC applications, ensure the CLASSPATH environment variable includes the jdbcMx.jar file. Given the default installation, the path is /usr/tandem/jdbcMx/current/lib/jdbcMx.jar Home | Contents | Index | Glossary | Prev | Next HP JDBC Driver for SQL/MX Programmer's Reference (529777-001) © 2004, 2005 Hewlett-Packard Development Company L.P. All rights reserved.
Home | Contents | Prev | Next | Index | Glossary Accessing SQL Databases with SQL/MX This section describes the following subjects: ● Connection to SQL/MX ● JDBC/MX Properties ● Transactions ● Stored Procedures ● SQL Context Management ● Nonblocking JDBC/MX ● Holdable Cursors ● Connection Pooling ● Statement Pooling ● Using Additional JDBC/MX Properties ● Supported Character Set Encodings Connection to SQL/MX A Java application can obtain a JDBC connection to SQL/MX in two ways: ● Using
● ● ● Specifying the JDBC/MX driver class in the -Djdbc.drivers option in the command line Using the Class.ForName method within the application Adding the JDBC/MX driver class to the jdbc.drivers property within the application The DriverManager.getConnection method accepts a string containing a JDBC URL. The JDBC URL for the JDBC/MX driver is jdbc:sqlmx:.
maxStatements minPoolSize maxPoolSize blobTableName clobTableName transactionMode See maxStatements Property. The total number of PreparedStatement objects that the connection pool should cache. See maxStatements Property. See minPoolSize Property. Limits the number of physical connections that can be in the free connection pool. See minPoolSize Property. int See maxPoolSize Property. Sets maximum number of physical connections that the pool should contain.
Guidelines for Using Connections with the DriverManager Class ● Java applications can specify the properties in the following ways: ❍ Using JDBC/MX properties with the -D option in the command line. If used, this option applies to all JDBC connections using the DriverManager within the Java application. The format is to enter the following in the command line: -Djdbcmx.property_name=property_value ● ● ● ● For example in a command line, -Djdbcmx.maxStatements=1024 ❍ Using the java.util.
catalog String See Default Catalog and Schema. schema String See Default Catalog and Schema. If the default catalog and schema are not specified, the JDBC/MX driver allows SQL/MX to follow its own rules for defaults. See catalog above. The registered ConnectionPoolDataSource name. When this string is empty, connection pooling is used by default with the pool size determined by the maxPoolSize property and minPoolSize property of the basic DataSource object.
mploc String See mploc Property. The location (in $volume.subvolume format) in which SQL/MP tables are created (The default location is the default subvolume of the logged-on user.) blobTableName String See LOB Table Name Properties. Specifies the LOB table for using BLOB columns. clobTableName String See LOB Table Name Properties. Specifies the LOB table for using CLOB columns. See transactionMode Property.
For information about using features provided by various JDBC/MX properties, see the topic, Using Additional JDBC/MX Properties. Default Catalog and Schema The default catalog and schema are used to access SQL objects referenced in SQL statements if the SQL objects are not fully qualified. The three-part fully qualified name for SQL/MX objects is of the form: [[catalog.]schema.]object-name The catalog and schema names can be any arbitrary strings that conform to SQL identifiers.
ISO88591 Property The ISO88591 character set mapping property corresponds to the SQL/MX ISO88591 character set, which is a single-byte 8-bit character set for character data types. The ISO88591 character set supports English and other Western European languages. Specify the ISO88591 property as String The default value is DEFAULT which uses the default Java encoding when accessing and writing to ISO88591 columns. The value can be any valid Java Canonical Name as listed in the "Canonical Name for java.
applications, because this pooling can dramatically help the performance of many applications. minPoolSize Property Limits the number of physical connections that can be in the free connection pool. Specify the minPoolSize property as: int The integer can be 0 through 2147483647, but less than maxPoolSize. The default is 0. Any negative value is treated like 0. Any value greater than maxPoolSize is changed to the maxPoolSize value. This value is ignored when maxPoolSize is -1.
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 drivers internally managed transaction, the existing external transaction is resumed. The Connection autoCommit flag maintains a value of true when in internal transaction mode.
batchBinding Specifies that statements are batched together in the executeBatch() operation. See Setting Batch Processing for Prepared Statements. jdbcmx. blobTableName Specifies the LOB table for using BLOB columns. See LOB Table Name Properties. jdbcmx. catalog Sets the default catalog. See Default Catalog and Schema. clobTableName Specifies the LOB table for using CLOB columns. See LOB Table Name Properties. jdbcmx.
jdbcmx. jdbcmx. jdbcmx. jdbcmx. sqlmx_nowait See Managing Nonblocking JDBC/MX. traceFile Specifies the trace file for logging. See Enabling Tracing for Application Servers. traceFlag Sets the trace flag for logging. See Enabling Tracing for Application Servers. transactionMode Sets the transaction mode, which provides control over how and when transactions are performed. See transactionMode Property.
Autocommit Mode and Transaction Boundaries When JDBC/MX manages the transactions, the driver decides to start a new transaction. A new transaction is started when no transaction is associated with the Connection. When there is a transaction associated with the Connection, that transaction is resumed. The Connection attribute autocommit specifies when to end the transaction.
Note: Do not use the SHORTANSI name type with stored procedures in Java (SPJs); SPJs do not support SHORTANSI. SQL Context Management NonStop SQL/MX allows you to manage SQL/MX contexts.
Holdable Cursors JDBC/MX driver supports the holdablity attribute for the ResultSet. To use holdable cursors in your JDBC applications, follow these guidelines: ● Use one of the following constants for the holdablity attribute: com.tandem.sqlmx.SQLMXResultSet.HOLD_CURSORS_OVER_COMMIT Ensure that when the application calls the method Connection.commit or Connection.rollback, the HOLD_CURSORS_OVER_COMMIT constant indicates that ResultSet objects are not closed. com.tandem.sqlmx.SQLMXResultSet.
Connection Pooling by an Application Server Usually, in a three-tier environment, the application server implements the connection pooling component.
initialPoolSize minPoolSize maxPoolSize maxIdleTime propertyCycle int The number of physical connections the pool should contain when it is created. int The number of physical connections the pool should keep available at all times. 0 (zero) indicates no maximum size. int The maximum number of physical connections that the pool should contain. 0 (zero) indicates no maximum size. int The number of seconds that a physical connection should remain unused in the pool before the connection is closed.
object to the client requests for a connection. JDBC/MX ensures that the SQL/MX execution environment and compilation environment remain the same for all the connections in the connection pooling environment; that is, the environment is the same as when the initial connection was obtained by the client session either from the pool or from a new physical connection.
Guidelines for Statement Pooling ● Enable statement pooling by setting the DataSource object maxStatements property to an integer value greater than 0 and, also, by enabling connection pooling. See Connection Pooling for more information. ● Enabling statement pooling for your JDBC applications might dramatically improve the performance. Explicitly close a prepared statement by using the Statement.
Troubleshooting Statement Pooling Note the following JDBC/MX driver implementation details if you are troubleshooting statement pooling: ● JDBC/MX driver looks for a matching PreparedStatement object in the statement pool and reuses the PreparedStatement. The matching criteria include the SQL string, current catalog, current schema, current transaction isolation, and resultSetHoldability.
Using Additional JDBC/MX Properties You can use JDBC/MX properties for the following application features: ● Managing Nonblocking JDBC/MX ● Setting Batch Processing for Prepared Statements ● Setting the reserveDataLocators Property In addition to these topics, also see Enabling Tracing for Application Servers. Managing Nonblocking JDBC/MX Blocking mode with the JDBC/MX driver causes the whole JVM process to be blocked when an SQL operation occurs.
● Do not share JDBC Java objects--such as Statement or ResultSet objects--across threads for purposes other than canceling the SQL operation with the Cancel() method. ● Be aware of the non-preemptive nature of the thread implementation in NonStop Server for Java 4. A CPU-bound thread runs to its completion without providing an opportunity for the thread scheduler to schedule a different thread.
total number of rows affected by all the statements executed by the PreparedStatement.executeBatch() method. Setting the reserveDataLocators Property The reserveDataLocators property sets the number of data locators to be reserved for a process for storing data in a LOB table. The default value for reserving data locators is 100. The property is of the form: jdbcmx.reserveDataLocators=n where n is an integer value of the number of data locators to be reserved.
ISO88591 UCS2 KANJI KSC5601 ISO-8859-1 UTF-16BE Shift_JIS EUC-KR (Code Set 1) ISO8859_1 Single-character, 8-bit, character set for character-data type. It supports English and other Western European languages. UnicodeBigUnmarked Universal Character Set encoded in 2 bytes. Double-character Unicode character set in UTF16 big-endian encoding. NOTE: UCS2 is supported in SQL/MX tables only. SJIS The multibyte character set widely used on Japanese mainframes.
For complete information on character sets supported by SQL/MX and any additional limitations on support for SQL/MP tables, see the SQL/MX Reference Manual. For complete information about NonStop Server for Java 4 support for encodings see Supported Encodings (http://java.sun.com/j2se/1.4.2/docs/guide/intl/encoding.doc.html). Home | Contents | Index | Glossary | Prev | Next HP JDBC Driver for SQL/MX Programmer's Reference (529777-001) © 2004, 2005 Hewlett-Packard Development Company L.P.
Home | Contents | Prev | Next | Index | Glossary Working with BLOB and CLOB Data This section describes working with BLOB and CLOB data in JDBC applications. You can use the standard interface described in the JDBC 3.0 API specification to access BLOB and CLOB data in NonStop SQL/MX tables with support provided by the JDBC/MX driver. BLOB and CLOB are not native data types in an SQL/MX database.
● NULL and Empty BLOB or CLOB Value ● Transactions Involving Blob and Clob Access ● Access Considerations for Clob and Blob Objects Miscellaneous For full working examples showing how to access BLOB and CLOB data, see Appendix A. For information about creating and managing tables for BLOB and CLOB data, see Managing the SQL/MX Tables for BLOB and CLOB Data.
Setting Properties for the LOB Table Before running the JDBC application that uses BLOB and CLOB data through the JDBC API, the database administrator must create the LOB tables. For information on creating LOB tables, see Managing LOB Data with the JDBC/MX Lob Admin Utility. The JDBC applications that access BLOB or CLOB data must specify the associated LOB table names and, optionally, configure the reserveDataLocator property.
CLOB clobTableName For more information about using these properties, see LOB Table Name Properties. Reserving Data Locators A data locator is the reference pointer value (SQL LARGEINT data type) that is substituted for the BLOB or CLOB column in the base table definition. Each object stored into the LOB table is assigned a unique data locator value.
The following code illustrates how to obtain the handle to an empty CLOB column: Clob myClob = null; Statement s = conn.createStatement(); ResultSet rs = s.executeQuery("Select myClobColumn from myTable where ….for update"); if (rs.next()) myClob = rs.getClob(1); You can now write data to the CLOB column. See Writing ASCII or Unicode Data to a CLOB Column. Writing ASCII or Unicode Data to a CLOB Column You can write ASCII or Unicode data to a CLOB column as follows.
Unicode Data The following code illustrates how to write Unicode data to a CLOB column after obtaining the handle to the empty CLOB column. Clob myClob = null; // stream begins at position 1 long pos = 1; // Example string containing the Unicode data String s = TEST_UNICODE_DATA; // Obtain the output stream to write Clob data Writer cw = myClob.setCharacterStream(pos); // write Clob data using Writer char[] myClobData = s.toCharArray(); cw.
Unicode Data You can insert a CLOB column with Unicode data from a FileReader. You must use the PreparedStatement interface to insert the CLOB column. FileReader inputReader = new FileReader(myClobTestFile); PreparedStatement ps = conn.prepareStatement("insert into myTable (myClobColumn) values (?)"); ps.setCharacterStream(1, inputReader, (int)myClobTestFile.length()); ps.executeUpdate(); The JDBC/MX driver reads the data from FileReader and writes the data to the LOB table.
// Obtain the Clob from ResultSet Clob myClob = rs.getClob("myClobColumn"); // Obtain the input stream to read Clob data InputStream is = myClob.getAsciiStream(); // read Clob data using the InputStream byte[] myClobData = new byte[length]; int readLen = is.read(myClobData, offset, length); To read ASCII or MBCS data from the CLOB column by using InputStream: // obtain the InputStream from ResultSet InputStream is = rs.
Updating CLOB Data You can make updates to CLOB data by using the methods in the Clob interface or by using the updateClob method of the ResultSet interface. The JDBC/MX driver makes changes directly to the CLOB data. Therefore, the JDBC/MX driver returns false to the locatorsUpdateCopy method of the DatabaseMetaData interface. Applications do not need to issue a separate update statement to update the CLOB data.
Deleting CLOB Data To delete CLOB data, the JDBC application uses the SQL DELETE statement to delete the row in the base table. When the row containing the CLOB column is deleted by the JDBC application, the corresponding CLOB data is automatically deleted by the delete trigger associated with the base table. For information about triggers, see Using an SQL/MX Trigger to Delete LOB Data. See also NULL and Empty BLOB or CLOB Value.
the next-available data locator. Then, you must obtain the handle to the empty BLOB column by selecting the BLOB column for update. The following code illustrates how to obtain the handle to an empty BLOB column: Blob myBlob = null; Statement s = conn.createStatement(); ResultSet rs = s.executeQuery("Select myBlobColumn from myTable where …For update"); if (rs.next()) myBlob = rs.getBlob(1); You can now write data to the BLOB column. See Writing Binary Data to a BLOB Column.
PreparedStatement ps = conn.prepareStatement("insert into myTable (myBlobColumn) values (?)"); ps.setBinaryStream(1, inputBinary, blobLen); ps.executeUpdate(); The JDBC/MX driver reads the data from FileInputSteam and writes the data to the LOB table. The JDBC/MX driver substitutes the next-available data locator for the parameter of the BLOB column in the table. Inserting a Blob Object by Using the setBlob Method Your JDBC application cannot directly instantiate a Blob object.
// read Blob data using the InputStream byte[] myBlobData = new byte[length]; is.read(myBlobData, offset, length); Updating BLOB Data You can update BLOB data by using the methods in the Blob interface or by using the updateClob method of the ResultSet interface. The JDBC/MX driver makes changes to the BLOB data directly. Hence, the JDBC/MX driver returns false to the locatorsUpdateCopy method of the DatabaseMetaData interface.
Deleting BLOB Data To delete BLOB data, the JDBC application uses the SQL DELETE statement to delete the row in the base table. When the row containing the BLOB column is deleted by the application, the corresponding BLOB data is automatically deleted by the delete trigger associated with the base table. For information about triggers, see Using an SQL/MX Trigger to Delete LOB Data. See also NULL and Empty BLOB or CLOB Value.
when LOB data is involved, autocommit is enabled, and an external transaction does not exist: ● Clob.setAsciiStream ● Clob.setCharacterStream ● Blob.setBinaryStream If an SQL/MX or FS exception occurs while the base table and LOB table are being updated, the internal transaction used for this operation is rolled back, and an exception is thrown.
HP JDBC Driver for SQL/MX Programmer's Reference (529777-001) © 2004, 2005 Hewlett-Packard Development Company L.P. All rights reserved.
Home | Contents | Prev | Next | Index | Glossary Managing the SQL/MX Tables for BLOB and CLOB Data BLOB and CLOB are not native data types in an SQL/MX database. But, database administrators can create SQL/MX tables that have BLOB and CLOB columns by using the JDBC/MX driver or special SQL syntax in MXCI as described in this section. For management purposes, CLOB and BLOB data is referred to as large object (LOB) data, which can represent either data type.
Using MXCI To Create Base Tables that Have LOB Columns 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' Follow these steps to create a base table that has LOB columns: 1. At the OSS prompt, invoke the SQL/MX utility MXCI. Type: MXCI 2.
Managing LOB Data by Using the JDBC/MX Lob Admin Utility The JDBC/MX driver provides the JDBC/MX Lob Admin Utility that you can use for these tasks: ● Creating the LOB table (a table that holds LOB data). ● Creating the SQL/MX triggers for the LOB columns in the base tables to ensure that orphan LOB data does not occur in a LOB table. Information about using the JDBC/MX Lob Admin Utility is provided in these topics.
-create Generates SQL statements to create LOB tables. These statements describe the architecture of the tables and, therefore, provide a description of the LOB tables. -trigger Generates SQL statements to create triggers for the designated table. The table must exist. -unicode Generates SQL statements to create unicode LOB tables. Use only for CLOB data. -drop Generate SQL statements to drop triggers for the designated table. The table must exist.
| is: .. is: [.][.] is the table that contains LOB column(s). is the table that contains the LOB data. Using SQL/MX Triggers to Delete LOB Data Use the JDBC/MX Lob Admin Utility to generate triggers to delete LOB data from the LOB table when the base row is deleted. These triggers ensure that orphan LOB data does not occur in the LOB table.
HP JDBC Driver for SQL/MX Programmer's Reference (529777-001) © 2004, 2005 Hewlett-Packard Development Company L.P. All rights reserved.
Home | Contents | Prev | Next | Index | Glossary JDBC/MX Compliance The JDBC Driver for SQL/MX conforms where applicable to the Sun Microsystems JDBC 3.0 API specification. However, the JDBC Driver for SQL/MX differs from the JDBC standard in some ways because of limitations of SQL/MX and the JDBC/MX driver. This subsection describes the JDBC methods that are not supported, the methods and features that deviate from the specification, and features that are HP extensions to the JDBC standard.
CallableStatement.getURL(String parameterName) CallableStatement.executeBatch() Connection.releaseSavepoint(Savepoint savepoint) Connection.rollback(Savepoint savepoint) Connection.setSavepoint() Connection.setSavepoint(String name) The particular Connection methods are not supported. PreparedStatement.setArray(int parameterIndex, Array x) PreparedStatement.setBlob(int parameterIndex, Blob x) PreparedStatement.setClob(int parameterIndex, Clob x) PreparedStatement.
Connection.prepareStatement(String sql, int autoGeneratedKeys) Connection.prepareStatement(String sql, int[] columnIndexes) Connection.prepareStatement(String sql, String[] columnNames) Automatically generated keys are not supported. Statement.execute(String sql, int autoGeneratedKeys) Statement.execute(String sql, int[] columnIndexes) Statement.execute(String sql, String[] columnNames) Statement.executeUpdate(String sql, int autoGeneratedKeys) Statement.
javax.sql.XAConnection javax.sql.XADataSource Distributed Transactions, as described in the JDBC 3.0 API specification, are not yet implemented. javax.sql.RowSet javax.sql.RowSetInternal javax.sql.RowSetListener javax.sql.RowSetMetaData javax.sql.RowSetReader javax.sql.RowSetWriter RowSet is not implemented in the JDBC Driver for SQL/MX. You can, however, download reference implementation of RowSet from Sun Microsystems (http://developer.java.sun.com/developer/earlyAccess/crs/).
java.sql.DriverManager.getConnection(String url, String usr, String password) java.sql.DriverManager.getConnection(String url, Properties info) javax.sql.DataSource.getConnection(String username, String password) User name and password arguments are ignored. All connections have the same security privileges as the user who invoked the Java VM. java.sql.DriverManager.setLoginTImeout(...) javax.sql.DataSource.setLoginTimeout(...) Login time-out is ignored. javax.sql.DataSource.
Batch Updates The batch update facility allows a Statement object to submit a set of heterogeneous update, insert, or delete commands together as a single unit to the database. This facility also allows multiple sets of parameters to be associated with a PreparedStatement object. When the autocommit mode is enabled, the JDBC Driver for SQL/MX commits the updates only when all commands in the batch succeed.
DEGREES DEGREES EXP EXP FLOOR FLOOR LOG LOG LOG10 LOG10 MOD MOD PI PI POWER POWER RADIANS RADIANS RAND Not supported in this release ROUND Not supported in this release SIGN SIGN SIN SIN SQRT SQRT TAN TAN TRUNCATE Not supported in this release String Functions JDBC Function SQL/MX Equivalent Function ASCII ASCII CHAR CHAR CONCAT Supported, but no equivalent SQL/MX function DIFFERENCE Not supported INSERT INSERT LCASE LOWER LEFT SUBSTRING LENGTH LENGTH LOCATE
UCASE UPPER | UPSHIFT Note: JDBC string functions in queries can return unexpected results for fixed-length (CHAR) column names because SQL/MX pads a fixed-length string with blanks up to the length of the definition, so the results from some JDBC string functions can include trailing blanks at the end of the string. Use the RTRIM function in queries to cause SQL/MX to trim extra blanks from the column names.
The SQL/MX CAST has this format: CAST( { value_exp | NULL } AS data_type ) SQL/MX translates the CONVERT syntax to the CAST syntax, converting the data type argument to its equivalent SQL/MX value. For example, if the JDBC data type parameter for character data is an integer value (SQL_CHAR or 1), the equivalent SQL/MX data type is a string literal with a value of CHARACTER.
Types.VARCHAR Yes VARCHAR(n) * See Floating Point Support. ** For details about maximum length, see the SQL/MX Reference Manual. The JDBC/MX driver maps the following SQL/MX data types to the JDBC data type Types.
SQL Escape Clauses JDBC/MX accepts SQL escape clauses and translates them into equivalent SQL/MX clauses, as shown in the following table: SQL Escape Clause SQL/MX Equivalent Clause { d 'date-literal' } DATE 'date-literal' { t 'time-literal' } TIME 'time-literal' { ts 'timestamp-literal' } TIMESTAMP 'timestamp-literal' { oj join-expression } join-expression * { INTERVAL sign interval-string interval-qualifier } INTERVAL sign interval-string interval-qualifier { fn scalar-function } scalar-funct
Home | Contents | Prev | Next | Index | Glossary JDBC Trace Facility The JDBC trace facility traces the entry point of all JDBC methods called from the Java applications. To make this facility generic, it is implemented as a JDBC driver wrapper.
jdbc:sqlmx: Java applications should turn on tracing using the DriverManager.setLogWriter method, for example by using the following JDBC API call in your application: DriverManager.setLogWriter(new PrintWriter(new FileWriter("FileName"))); Tracing Using the DataSource Implementation This is preferred way to establish a JDBC connection and to enable the JDBC trace facility.
The logFile is the file name that is to contain the tracing information. The n value for the traceFlag can be the following values: Value for n Description 0 No tracing. 1 Traces connection and statement pooling calls only. 2 Traces entry point of all JDBC methods. Tracing Using the system.setProperty Method Enable tracing by using the System.setProperty(key, value) to set the same value as described above. For example: System.setProperty("traceFile", "myLogFile.log"); System.
Tracing Using a Wrapper Data Source Enable tracing by creating a wrapper data source around the data source to be traced. The wrapper data source contains the TraceDataSource property that you can set to the data source to be traced. For information about demonstration programs that show using this method, see JDBC Trace Facility Demonstration Programs.
-Djdbcmx.traceFlag=n where n is an integer that specifies the tracing level. The value can be 0, 1, or 2. The default level is 0. Any value greater than 2 is treated like 2. The tracing levels are: Level Meaning 0 No tracing. 1 Traces connection and statement pooling information. 2 Traces connection and statement pooling information, as in Level 1 and traces the entry point of all JDBC methods. Output Format The format of the trace output is as follows: jdbcTrace:[thread-id]:[object-id]:className.
JDBC Trace Facility Demonstration Program The JDBC/MX driver provides jdbcTrace demonstration programs in the installation directory. The programs are described in the README_JDBCTrace file. For the location, see JDBC/MX Driver File Locations. These programs demonstrate tracing by creating a wrapper around the driver-specific data source to be traced. For additional information, see Sample Programs Summary.
Home | Contents | Prev | Next | Index | Glossary Migration This section describes the considerations and application changes required to migrate applications from the JDBC/MX V30 and V31 drivers to the JDBC/MX V32 driver. The topics are: Summary of Migration Changes for JDBC/MX Driver Versions Migration Topic Migrating from V30 Migrating from V31 Transactions Applies N/A nametype Property Applies N/A Deprecated Property-Name Specification Applies N/A Row Count Array of the PreparedStatement.
Transactions Transaction semantics changed in the V31 product from the previous versions of the JDBC/MX driver when the connection is set to autocommit mode. In previous releases, when multiple select statements were involved in a transaction in autocommit mode, the JDBC/MX driver ended the transaction when any select statement result set was closed. In this release, the JDBC/MX driver ends the transaction only when the result set of the select statement that started the transaction is closed.
Deprecated Property-Name Specification New Property-Name Specification catalog jdbcmx.catalog schema jdbcmx.schema mploc jdbcmx.mploc maxPoolSize jdbcmx.maxPoolSize minPoolSize jdbcmx.minPoolSize maxStatements jdbcmx.maxStatements traceFile jdbcmx.traceFile traceFlag jdbcmx.traceFlag sqlmx_nowait jdbcmx.sqlmx_nowait Note: Support for the deprecated property-name specification will end in a future JDBC/MX driver release.
Using Character Encoding Sets and SQL Databases If your application uses Java character encoding sets and accesses SQL databases, consider the change in the JDBC/MX V31 and V32 drivers' support of multibyte character sets and how the change might affect your application. The JDBC/MX driver now supports the reading and writing of CHAR, VARCHAR, VARCHAR_LONG, and VARCHAR_WITH_LENGTH data types that utilize a double-byte character set.
For Java migration issues, see the NonStop Server for Java Programmer's Reference. Release of NonStop SQL/MX JDBC/MX requires a NonStop SQL/MX version as follows: ● JDBC/MX V30 requires NonStop SQL/MX 1.8.5. ● JDBC/MX V31 requires NonStop SQL/MX 2.0. ● JDBC/MX V32 requires NonStop SQL/MX 2.0 or all subsequent 2.x versions until otherwise indicated in a new edition. For SQL/MX migration issues, see the SQL/MX Installation and Management Guide.
Home | Contents | Prev | Next | Index Messages JDBC/MX returns sqlcode and file-system error codes as error codes for the getErrorCode() method of SQLException. Messages from the Java Portion of the JDBC Driver (range 29000 through 29249) 29001-29009 29040-29049 29010-29019 29050-29059 29020-29029 29060-29069 29030-29039 29070-29076 Messages from the Native-interface Portion of the JDBC Driver (range 29250 through 29499) 29251-29259 29260-29265 Messages are listed in numerical SQLCODE order.
[back to the top] 29002 08003 Connection does not exist Cause: An action was attempted when the connection to the database was closed. Effect: The database is inaccessible. Recovery: Retry the action after the connection to the database is established. [back to the top] 29003 HY000 Statement does not exist Cause: A validation attempt was made on the getter or exec invocation on a closed statement. Effect: The getter or exec invocation validation fails.
29006 HY000 Invalid Result Set concurrency Cause: An attempt was made to set an invalid result-set concurrency value. Effect: The SQLMXStatement call with resultSetConcurrency fails. Recovery: Valid resultSetConcurrency values are: CONCUR_READ_ONLY and CONCUR_UPDATABLE. [back to the top] 29007 07009 Invalid descriptor index Cause: A ResultSetMetadata column parameter or a ParameterMetaData param parameter is outside of the descriptor range.
validateGetInvocation(), and validateUpdInvocation() methods. [back to the top] 29011 07009 Invalid column index or descriptor index Cause: A ResultSet method was issued that has a column parameter that is outside of the valid range. Effect: The ResultSet method data is not returned as expected. Recovery: Make sure to validate the column that is supplied to the method.
29015 HY024 Invalid fetch direction Cause: The setFetchDirection() method direction parameter is set to an invalid value. Effect: The direction in which the rows in this ResultSet object are processed is not set. Recovery: Valid fetch directions are: ResultSet.FETCH_FORWARD, ResultSet.FETCH_REVERSE, and ResultSet.FETCH_UNKNOWN.
[back to the top] 29020 07009 Invalid parameter index Cause: A getter or setter method parameter count index is outside of the valid input-descriptor range, or the input-descriptor range is null. Effect: The getter and setter method invocation validation fails. Recovery: Change the getter or setter parameter index to a valid parameter value. [back to the top] 29021 HY004 Object type not supported Cause: A prepared-statement setObject() method call contains an unsupported Object Type.
29024 HY109 The cursor is after last row, which could be due to the result set containing no rows, or all rows have been retrieved. Cause: getCurrentRow() is called when the cursor is after the last row. Effect: An exception is reported; no data is retrieved. Recovery: Validate the application call to the getCurrentRow() method.
29028 22003 The data value ({0}) is negative, but the column/parameter number {1,number,integer} is unsigned Cause: An attempt was made to set a negative value into an unsigned column. Effect: An exception is thrown; data is not updated. Recovery: Make sure that the value is within the valid range for the column type.
the row. [back to the top] 29033 23000 Primary key column value can't be updated Cause: An attempt was made to update the primary-key column in a table. Effect: The column is not updated. Recovery: Columns in the primary-key definition cannot be updated and cannot contain null values, even if you omit the NOT NULL clause in the column definition. [back to the top] 29035 HY000 IO Exception occurred {0} Cause: An ASCII or Binary or Character stream setter or an updater method resulted in a java.io.
29038 HY107 Row number is not valid Cause: A ResultSet absolute() method was called when the row number was set to 0. Effect: The cursor is not moved to the specified row number. Recovery: Supply a positive row number (specifying the row number counting from the beginning of the result set), or supply a negative row number (specifying the row number counting from the end of the result set).
29042 HY000 Fetch size value is not valid Cause: An attempt was made to set the fetch-row size to a value that is less than 0. Effect: The number of rows that are fetched from the database when more rows are needed is not set. Recovery: For the setFetchSize() method, supply a valid row value that is greater than or equal to 0.
[back to the top] 29047 HY000 Batch update failed. See next exception for details Cause: One of the commands in a batch update failed to execute properly. Effect: Not all the batch-update commands succeed. See the subsequent exception for more information. Recovery: View the subsequent exception for possible recovery actions. [back to the top] 29048 HY009 Invalid use of null Cause: A parameter that has an expected table name is set to null. Effect: The DatabaseMetadata method does not report any results.
Recovery: This message is reported as an SQL Warning. It is an informational message only; no recovery is needed. [back to the top] 29052 22003 The Timestamp ({0}) is not in format yyyy-mm-dd hh:mm:ss.fffffffff for column/parameter number {1,number,integer} Cause: An attempt was made to enter an invalid timestamp format into a TIMESTAMP column type. Effect: An exception is thrown; data is not updated. Recovery: Make sure that a timestamp in the form of yyyy-mm-dd hh:mm:ss.fffffffff is used.
[back to the top] 29056 HY000 Statement is already closed Cause: A validateSetInvocation() or validateExecuteInvocation method was used on a closed statement. Effect: The validation on the statement fails and returns an exception. Recovery: Use the validateSetInvocation() or validateExecuteInvocation method prior to the statement close. [back to the top] 29057 HY000 Auto generated keys not supported Cause: An attempt was made to use the Auto-generated keys feature. Effect: The attempt does not succeed.
[back to the top 29060 HY000 'clobTableName' property is not set or set to null value or set to invalid value Cause: clobTableName property is not set or is set to null value or set to an invalid value. Effect: The application cannot access CLOB columns. Recovery: Set the clobTableName property to a valid LOB table name. The LOB table name is of format catalog.schema.lobTableName.
[back to the top] 29064 22018 Java data type does not match SQL data type for column Cause: Attempted to call a PreparedStatement setter method with an invalid column data type. Effect: An exception is thrown; data is not updated. Recovery: Make sure that the column data type is valid for the PreparedStatement setter method.
29068 07009 The value for position can be any value between 1 and one more than the length of the LOB data Cause: The position input value in Blob.setBinaryStream, Clob.setCharacterStream, or Clob.setAsciiStream can be between 1 and one more than the length of the LOB data. Effect: The application cannot write the LOB data at the specified position. Recovery: Correct the position input value.
29072 HY000 Maximum connection pool size ({0,number,integer}) has been exceeded ({1,number,integer}) Cause: An attempt was made to obtain a connection outside the set connection pool size limit. Effect: An exception is thrown. Recovery: Increase the connection pool size using the maxPoolSize command-line property.
29076 HY000 Exceeded 'maxStatements' ({0,number,integer}) -- performance may be compromised Cause: The cached statement count has reached the limit set by the maxStatements property and all statements are in use. Effect: An exception is thrown to indicate that the maxStatements limit has been exceeded. Recovery: Use the maxStatements property to increase the number of statements allowed.
[back to the top] 29254 22001 String data right-truncated Cause: An attempt was made to place a string in a database but the string exceeds the database limits. Effect: Some of the data is not placed in the database. Recovery: Shorten the length of the string. [back to the top] 29255 HY000 TMF error has occurred : [tmf-error] Cause: An internal transaction request failed. Effect: An exception is reported; the operation is not completed. Recovery: Refer to the TMF error message tmf-error.
[back to the top] 29259 HY000 Module Error Cause: An invalid parameter was detected when attempting to get catalog information or attempting to prepare a statement from a module. Effect: An exception is reported; the operation is not completed. Recovery: See the exception message for recovery details. [back to the top] 29260 HY000 Invalid Statement/Connection Handle Cause: An invalid SQL statement handle was detected. Effect: An exception is reported; the operation is not completed.
Recovery: Make sure that the statement-label parameter is valid. [back to the top] 29264 HY000 Invalid or null module name Cause: A calling database stored a procedure or a prepared statement that has an invalid module-name input parameter. Effect: The stored procedure or prepared statement is not executed. Recovery: Make sure that the module-name parameter is valid.
Home | Contents | Prev | Next | Index | Glossary Appendix A. Sample Programs Accessing CLOB and BLOB Data This appendix shows two working programs: ● Sample Program Accessing CLOB Data ● Sample Program Accessing BLOB Data Sample Program Accessing CLOB Data This sample program shows operations that can be performed through the CLOB interface or through the PreparedStatement interface.
// - use Outputstream.write(byte[]) // // ***** The following is the PreparedStatement interface... // - need an Inputstream object that already has data // - need a PreparedStatement object that contains the // 'insert...' DML of the base table // - ps.setAsciiStream() for the lob data // - ps.executeupdate(); for the DML // // To run this example, issue the following: // # java TestCLOB 1 TestCLOB.java 1000 // import java.sql.*; import java.io.
if (args.length == 3) length = Integer.parseInt(args[2]); recKey = Integer.parseInt(args[0]); System.out.println("Key: " + recKey +"; Using " + length + " of file " + args[1]); try { Class.forName("com.tandem.sqlmx.SQLMXDriver"); start = System.currentTimeMillis(); conn1 = DriverManager.getConnection("jdbc:sqlmx:"); System.out.println("Cleaning up test tables..."); Statement stmt0 = conn1.createStatement(); stmt0.execute("delete from clobdatatbl"); stmt0.execute("delete from clobbase"); conn1.
// Clob interface example - This technique is suitable when // the LOB data is already in the app, such as having been // transferred in a msgbuf. try { // insert a second base table row with an empty LOB column System.out.println("CLOB interface EMPTY LOB insert..."); String stmtSource2 = "insert into clobbase values (?,EMPTY_CLOB())"; PreparedStatement stmt2 = conn1.prepareStatement(stmtSource2); stmt2.setInt(1,recKey+1); stmt2.executeUpdate(); Clob clob = null; // System.out.
Sample Program Accessing BLOB Data This sample program shows the use of both the Blob interface and the PreparedStatement interface to take a byte variable and put the variable's value into a base table that has a BLOB column. // LOB operations may be performed throubh the Blob, or // PreparedStatement interface. This program shows examples of // using both interfaces taking a byte[] variable and putting // it into the cat.sch.blobtiff table.
public class TestBLOB { public static void main (String[] args) throws java.io.FileNotFoundException, java.io.IOException { int numBytes; int recKey; long start; long end; Connection conn1 = null; // Set jdbcmx.blobTableName System Property. This property // can also be added to the command line through // "-Djdbcmx.blobTableName=...", or a // java.util.Properties object can be used and passed to // getConnection. System.setProperty( "jdbcmx.blobTableName","cat.sch.blobdatatbl" ); if (args.
Statement stmt0 = conn1.createStatement(); stmt0.execute("delete from blobdatatbl"); stmt0.execute("delete from blobtiff"); conn1.setAutoCommit(false); } catch (Exception e1) { e1.printStackTrace(); } // PreparedStatement interface example - This technique is // suitable if the LOB data is already on the // NonStop system disk. try { System.out.println("PreparedStatement interface LOB insert..."); String stmtSource1 = "insert into blobtiff values (?,?)"; PreparedStatement stmt1 = conn1.
update (EMPTY in this case)..."); PreparedStatement stmt3 = conn1.prepareStatement("select tiff from blobtiff where col1 = ? for update"); stmt3.setInt(1,recKey+1); ResultSet rs = stmt3.executeQuery(); if (rs.next()) tiff = rs.getBlob(1); // has to be there else the base table insert failed System.out.println("Writing data to previously empty BLOB..."); OutputStream os = tiff.setBinaryStream(1); byte[] bData = k.getBytes(); os.write(bData); os.close(); conn1.commit(); } catch (SQLException e) { e.
Home | Contents | Prev | Next | Index Glossary ABCDEFGHIJLMNOPQRSTUVWXYZ A abstract class In Java, a class designed only as a parent from which subclasses can be derived, which is not itself suitable for instantiation. An abstract class is often used to "abstract out" incomplete sets of features, which can then be shared by a group of sibling subclasses that add different variations of the missing pieces.
autocommit mode A mode in which a JDBC driver automatically commits a transaction without the programmer's calling commit(). B base table A table that has physical existence: that is, a table stored in a file. BLOB Short for Binary Large OBject, a collection of binary data stored as a single entity in a database management system. These entities are primarily used to hold multimedia objects such as images, videos, and sound. They can also be used to store programs or even fragments of code.
management system. A Java Clob object (Java type, java.sql.Clob) corresponds to the SQL CLOB data type. client A software process, hardware device, or combination of the two that requests services from a server. Often, the client is a process residing on a programmable workstation and is the part of a program that provides the user interface. The workstation client might also perform other portions of the program logic. Also called a requester.
driver A class in JDBC that implements a connection to a particular database management system such as SQL/MP. The NonStop Server for Java 4 has these driver implementations: JDBC Driver for SQL/MP (JDBC/MP) and JDBC Driver for SQL/MX (JDBC/MX). DriverManager The JDBC class that manages drivers. E exception An event during program execution that prevents the program from continuing normally; generally, an error.
system procedure calls as their API. Interactive users of the Guardian environment use the HP Tandem Advanced Command Language (TACL) or another HP product's command interpreter. Compare to OSS. H Hotspot virtual machine See Java Hotspot virtual machine. HP JDBC Driver for SQL/MP (JDBC/MP) The product that provides access to SQL/MP and conforms to the JDBC API. HP JDBC Driver for SQL/MX (JDBC/MX) The product that provides access to SQL/MX and conforms to the JDBC API.
hypertext A collection of documents (nodes) containing cross-references or links that, with the aid of an interactive browser, allow a reader to move easily from one document to another. Hypertext Mark-up Language (HTML) A hypertext document format used on the World Wide Web. Hypertext Transfer Protocol (HTTP) The client-server Transmission Control Protocol/Internet Protocol (TCP/IP) used on the World Wide Web for the exchange of HTML documents. I IEC See International Electrotechnical Commission (IEC).
❍ environments, including among systems from multiple vendors or with multiple versions of operating systems from the same vendor. HP documents often use the term connectivity in this context, while other vendors use connectivity to mean hardware compatibility. Within a NonStop system node, the ability to use the features or facilities of one environment from another.
Invocation API that invokes a Java VM from a C program. Java Run-time The JVM and the Core Packages. This is the standard Java environment that the java command invokes. Java virtual machine (JVM) The process that loads, links, verifies, and interprets Java bytecode. The NonStop Server for Java 4 implements the Java HotSpot virtual machine. JDBC See Java Database Connectivity (JDBC). JDBC API The programmatic API in Java to access relational databases.
M MXCI SQL/MX Conversational Interface. N native In the context of Java programming, something written in a language other than Java (such as C or C++) for a specific platform. node One of the following: ❍ An addressable device attached to a computer network. ❍ A hypertext document. NonStop Server for Java 4 The informal name of the NonStop Server for Java, based on the Java 2 Platform, Standard Edition, SDK 1.4.x products.
P package A collection of related classes; for example, JDBC. persistence A property of a programming language where created objects and variables continue to exist and retain their values between runs of the program. portability The ability to transfer programs from one platform to another without reprogramming. A characteristic of open systems. Portability implies use of standard programming languages such as C.
S scalability The ability to increase the size and processing power of an online transaction processing system by adding processors and devices to a system, systems to a network, and so on, and to do so easily and transparently without bringing systems down. Sometimes called expandability. server One of the following: ❍ An implementation of a system used as a stand-alone system or as a node in an Expand network.
systems because storing the procedure on the server side means that it is available to all clients. And when the procedure is modified, all clients automatically get the new version. stored procedure in Java (SPJ) A stored procedure whose body is a static Java method. stub One of the following: ❍ A dummy procedure used when linking a program with a run-time library. The stub need not contain any code. Its only purpose is to prevent "undefined label" errors at link time.
insert, or update operation occurs on a specified base table. U Unicode A character-coding scheme designed to be an extension of ASCII. By using 16 bits for each character (rather than ASCII's 7), Unicode can represent almost every character of every language and many symbols (such as "&") in an internationally standard way, eliminating the complexity of incompatible extended character sets and code pages. Unicode's first 128 codes correspond to those of standard ASCII.
Home | Contents | Index | Prev | Next HP JDBC Driver for SQL/MX Programmer's Reference (529777-001) © 2004, 2005 Hewlett-Packard Development Company L.P. All rights reserved.
Home | Contents | Prev | Next | Glossary Index ABCDEFGHIJKLMNOPQRSTUVWXYZ A Abbreviations used in this document Accessing NonStop SQL databases with JDBC/MX driver Admin Utility See JDBC/MX Lob Admin Utility ANSI API packages Application servers connection pooling tracing Architecture JDBC/MX driver LOB support ASCII data inserting by using the PreparedStatement interface reading from a CLOB column writing by using the Clob interface Audience for this document Autocommit mode application migration issues
batchBinding property BLOB (Binary Large Object) accessing, sample program creating tables for data type deleting data limitations managing tables for reading data storing data support architecture updating data working with Blob interface inserting BLOB columns reading binary data from a CLOB column using Blob objects access considerations replacing blobTableName property Blocking Java VM process See Nonblocking JDBC/MX C Catalog, default Character set encodings ISO88591 property migration considerations
support architecture updating data working with Clob interface inserting CLOB columns reading ASCII data from a CLOB column using Clob objects access considerations inserting by using the setClob method clobTableName property Compliance Connecting to SQL/MX using the DataSource interface using the DriverManager class Connection pooling by an application server sample program using the basic DataSource API with the DriverManager class Control Query command Conventions, notation Creating tables Cursors, holda
Deleting BLOB data CLOB data Demonstration programs of JDBC trace facility summary Deprecated property names Deviations from JDBC in JDBC/MX 3.
Fetch size File encoding migration considerations File locations installation migration considerations Floating point support G getConnection method See Connecting programs to databases H Help listing, JDBC/MX Lob Admin Utility Holdable cursors JDBC/MX support sample program HP extensions, JDBC 3.
J java command-line options enabling tracing jdbcmx. property name prefix setting JDBC/MX driver properties Java Database Connectivity See JDBC Driver for SQL/MX See also JDBC API, 3.0 JDBC API, 3.
K KANJI character set KSC5601 character set L Limitations, CLOB and BLOB data types LOB (Large Object) See also BLOB See also CLOB managing tables for working with support architecture Lob Admin Utility See JDBC/MX Lob Admin Utility LOB table creating deleting LOB data format reserving data locators setting column type setting the reserveDataLocators property table name properties locatorsUpdateCopy method for BLOB data for CLOB data M Managing tables using the JDBC/MX Lob Admin Utility maxPoolSize proper
mploc property Multibyte character set (MBCS) data character set encodings inserting by using the PreparedStatement interface reading from a CLOB column writing by using the Clob interface supported character sets Multithreaded Java application sample program MXCI, using N nametype property, migration Nonblocking JDBC/MX NonStop SQL/MX documents Notation conventions NULL value O Objects See SQL objects Orphan LOB data P Performance ResultSet processing, controlling the performance setting batch processin
Properties additional JDBC/MX properties DataSource object deprecated property names DriverManager class JDBC/MX driver properties jdbcmx.
accessing CLOB data summary of demos Schema, default setClob method setLogWriter method SHORTANSI names SPJs See Stored procedures SQL conformance by JDBC/MX SQL context management SQL tables sqlmx_nowait property SQLException for maxPoolSize property for updatable result set for unsupported features JDBC error messages Statement pooling controlling the performance of ResultSet processing feature description sample program Stored procedures Storing BLOB data CLOB data T Tables See also LOB table base creat
Tracing See JDBC Trace Facility transactionMode property Transactions application migration autocommit mode and transaction boundaries Blob and Clob access disabling autocommit mode modes support of Triggers creating dropping example creating using Troubleshooting connection pooling statement pooling U UCS2 character set Unicode character set Unicode data inserting by using the PreparedStatement interface LOB tables, creating reading Unicode data from a CLOB column writing by using the Clob interface updat
V Verifying installation W Writer Blob and Clob access considerations Unicode data to a Clob Writing See also Storing ASCII or Unicode data to CLOB columns ABCDEFGHIJKLMNOPQRSTUVWXYZ Home | Contents | Glossary | Prev | Next HP JDBC Driver for SQL/MX Programmer's Reference (529777-001 ) © 2004, 2005 Hewlett-Packard Development Company L.P. All rights reserved.
Home | Contents | Prev | Next | Index | Glossary List of Examples Section Title Example Title(s) Installing and Verifying JDBC/MX ● Verifying the JDBC/MX Driver Working with BLOB and CLOB Data ● Inserting CLOB Columns by Using the Clob Interface ● Writing ASCII or Unicode Data to a CLOB Column ● Inserting CLOB Data by Using the PreparedStatement Interface ● Reading ASCII Data from a CLOB Column ● Reading Unicode Data from a CLOB Column ● Inserting a BLOB Column by Using the Blob Interface
Home | Contents | Prev | Next | Index | Glossary List of Figures Section Title Figure Title(s) Introduction to JDBC/MX ● Architecture of the JDBC Driver for SQL/MX Working with BLOB and CLOB Data ● LOB Architecture: Tables for LOB Data Support HP JDBC Driver for SQL/MX Programmer's Reference (529777-001) © 2004, 2005 Hewlett-Packard Development Company L.P. All rights reserved.
Home | Contents | Prev | Index | Glossary List of Tables Section Title Table Title(s) About This Manual ● Document Sections Introduction to JDBC/MX Driver ● Sample Programs Summary Accessing SQL Databases with SQL/MX ● JDBC/MX Driver Properties Used with the DriverManager Class ● DataSource Object Properties ● JDBC/MX Driver Properties Allowed in the Command Line ● Connection Attributes Passed to SQL/MX Context ● Standard ConnectionPoolDataSource Object Properties ● Corresponding SQL/MX
Migration Messages ● Summary of Migration Changes for JDBC/MX Driver Versions ● Summary of Deprecated Property-Name Specifications for Use in the Command Line ● Ranges for JDBC Messages Home | Contents | Index | Glossary | Prev | HP JDBC Driver for SQL/MX Programmer's Reference (529777-001) © 2004, 2005 Hewlett-Packard Development Company L.P. All rights reserved.