HP Neoview JDBC Type 4 Driver Programmer's Reference HP Part Number: 544564–001 Published: August 2007 Edition: HP Neoview Release 2.
© Copyright 2007 Hewlett-Packard Development Company, L.P. Legal Notice Confidential computer software. Valid license from HP required for possession, use or copying. Consistent with FAR 12.211 and 12.212, Commercial Computer Software, Computer Software Documentation, and Technical Data for Commercial Items are licensed to the U.S. Government under vendor’s standard commercial license. The information contained herein is subject to change without notice.
Table of Contents About This Document.......................................................................................................11 Release...................................................................................................................................................11 Intended Audience................................................................................................................................11 New and Changed Information.....................................
INFOSTATS Command for Obtaining Query Costs.............................................................................29 Use of the INFOSTATS Command..................................................................................................30 Internationalization Support................................................................................................................31 When String Literals Are Used in Applications........................................................................
url Property.....................................................................................................................................50 url Property Considerations.......................................................................................................50 user Property...................................................................................................................................50 5 Working with BLOB and CLOB Data..................................................
7 Type 4 Driver Compliance..........................................................................................65 Compliance Overview..........................................................................................................................65 Unsupported Features..........................................................................................................................65 Deviations..............................................................................................
List of Tables 3-1 3-2 4-1 4-2 4-3 4-4 4-5 4-6 4-7 JDBC Type 4 Driver Character-Set Mapping................................................................................31 Corresponding Neoview Character Sets and Java Encoding Sets................................................31 Connection Control Properties......................................................................................................35 Pooling Management Properties................................................................
List of Examples 6-1 8-1 Type 4 Lob Admin Utility Help....................................................................................................62 Example of Setting Logging in properties File..............................................................................
About This Document This document describes how to use the HP JDBC Type 4 Driver (subsequently called the Type 4 driver). This driver provides Java applications running on a foreign platform with JDBC access to HP Neoview SQL databases on the HP Neoview Data Warehousing Platform for Business Intelligence. Release This manual supports HP Neoview Release 2.2 until otherwise indicated in a replacement publication.
Chapter (page) Title Use for ... Chapter 6 (page 59) “Managing the SQL Tables for BLOB Database management (administrative) tasks for adding and and CLOB Data” managing the tables for BLOB and CLOB data. The Type 4 driver uses Neoview base tables in implementing support for BLOB and CLOB data access. Chapter 7 (page 65) “Type 4 Driver Compliance” Information about how the Type 4 driver differs from the Sun Microsystems JDBC 3.0 standard. Lists unsupported features for Neoview SQL.
is no space between two items, spaces are not permitted. In this example, spaces are not permitted before or after the period: %h/hpt4jdbc%u.log Related Documentation Related documentation includes: • “Type 4 Driver APIs” (page 13) • “Neoview Customer Library” (page 13) Type 4 Driver APIs Sun Microsystems Documents The following documents were available on Sun Microsystems Web sites when the HP Neoview JDBC Type 4 Driver was released.
• • Neoview Management Dashboard Client Guide for Database Administrators Information on using the Dashboard Client, including how to install the Client, start and configure the Client Server Gateway (CSG), use the Client windows and property sheets, interpret entity screen information, and use Command and Control to manage queries from the Client. Neoview Owner’s Manual Site-planning information and basic hardware information.
DML. Data Manipulation Language ISO. International Organization for Standardization JAR. Java Archive JDBC. Java Database Connectivity JDK. Java Development Kit JNDI. Java Naming and Directory Interface JRE. Java Run-time Environment LOB. Large object NDCS. Neoview Database Connectivity Service SPJ. stored procedure in Java SQLJ. embedded SQL in Java programs URL. uniform resource locator VM.
1 Introduction to HP JDBC Type 4 Driver This document describes how to use the HP JDBC Type 4 Driver. This driver provides Java applications running on a foreign platform with JDBC access to HP Neoview SQL databases on the HP Neoview Data Warehousing Platform for Business Intelligence. Supported Java Releases: The Type 4 driver requires Java enabled platforms that support JDK 1.4.1 or higher. Type 4 Driver API Package The Type 4 driver package, com.hp.t4jdbc, is shipped with the driver software.
2 Installing and Verifying the Type 4 Driver This chapter describes: • “Downloading the Sofware” (page 19) • “Linking to Installation Instructions” (page 19) • “Product Files” (page 19) • “Setting CLASSPATH” (page 20) • “Verifying the Type 4 Driver” (page 20) Downloading the Sofware The HP Neoview JDBC Type 4 client software is available for downloading from the HP Software Depot Web site: www.software.hp.
Setting CLASSPATH Before running JDBC applications, ensure the CLASSPATH environment variable includes the hpt4jdbc.jar file and installation directory. The hpt4jdbc.jar file is located in the lib directory where you installed the product. Verifying the Type 4 Driver To verify the version of the Type 4 driver, use the command: java -jar hpt4jdbc.jar This command displays output similar to: Version procedure: T1249_N24(R2.
3 Accessing Neoview SQL Databases This chapter discusses accessing Neoview SQL databases. • “Data Sources” (page 21) • “Security” (page 22) • “How to Make a Connection to Neoview SQL” (page 22) • “Connection by Using the DataSource Interface” (page 22) • “Connection by Using the DriverManager Class” (page 24) • “Connection Pooling” (page 27) • “Statement Pooling” (page 28) • “Thread-Safe Database Access” (page 29) • “"Update ...
Security Clients connect to the Neoview platform with a valid user name and ID, using standard JDBC 3.0 APIs. An application can make multiple connections using different user IDs, and creating different Connection objects. The Type 4 driver provides for user name and password authentication. The password is encrypted with a proprietary algorithm provided by NDCS. NOTE: There is no secure wire communication such as SSL provided for the communication between Type 4 driver and the Neoview platform.
An instance of the DataSource class and the DataSource object properties are usually set by an application developer or system administrator using a GUI tool as part of the installation of the data source. If you are using an installed data source, see “Programmatically Creating an Instance of the DataSource Class” (page 23). The subsequent topics show an example of performing these tasks programmatically.
javax.naming.Context ctx = new javax.naming.InitialContext(env); ctx.rebind("myDataSource", ds); Retrieving a DataSource Instance by Using JNDI and Connecting to the Data Source Typically, the JDBC application looks up the data source JNDI name from a context object. Once the application has the DataSource object, the application does a getConnection() call on the data source and gets a connection.
finds a suitable driver that recognizes this URL and obtains a database connection using that driver. com.hp.t4jdbc.HPT4Driver is the Type 4 driver class that implements the java.sql.Driver interface.
1. 2. Using the java.util.Properties parameter in the getConnection method of DriverManager class. Using the database URL in the DriverManager.getconnection method, where the URL is: jdbc:hpt4jdbc://ip_addr_or_host_name:18650/:property=value ip_addr_or_host_name 3. is the primary IP address or host name for the Neoview database. Using a properties file for the JDBC driver. The properties file is passed as a command-line parameter.
Connection Pooling The Type 4 driver provides an implementation of connection pooling, where a cache of physical database connections are assigned to a client session and reused for the database activity. If connection pooling is active, connections are not physically closed. The connection is returned to its connection pool when the Connection.close() method is called. The next time a connection is requested by the client, the driver will return the pooled connection, and not a new physical connection.
Statement Pooling The statement pooling feature allows applications to reuse the PreparedStatement object in the same way that they can reuse a connection in the connection pooling environment. Statement pooling is completely transparent to the application. Guidelines for Statement Pooling • • • • To enable statement pooling, set the maxStatements property to an integer value greater than 0 and enable connection pooling.
Thread-Safe Database Access In the Type 4 driver, API layer classes are implemented as instance-specific objects to ensure thread safety: • • • HPT4DataSource.getConnection() is implemented as a synchronized method to ensure thread safety in getting a connection. Once a connection is made, the Connection object is instance-specific. If multiple statements are run on different threads in a single connection, statement objects are serialized to prevent data corruption. "Update ...
Column Description TotalTime (SQL_DOUBLE) Estimated cost associated to execute the query. Cardinality (SQL_DOUBLE) Estimated number of rows that will be returned. Use of the INFOSTATS Command The INFOSTATS command can only be used with PreparedStatement objects. The syntax is: INFOSTATS cusor_name where cusor_name is the name of the prepared statement. If the cursor name is, case-sensitive, enclose in single quotes.
Internationalization Support • • • “When String Literals Are Used in Applications” (page 31) “Controlling String Literal Conversion by Using the Character-Set Properties” (page 31) “Localizing Error Messages and Status Messages” (page 32) When String Literals Are Used in Applications Internationalization support in the driver affects the handling of string literals. The Type 4 driver handles string literals in two situations. • When the driver processes an SQL statement.
Retrieving a Column When you retrieve a column as a String (for example, call the getString() or getCharacterStream methods), the Type 4 driver uses the character-set mapping property key to instantiate a String object (where that key corresponds to the character set of the column).
HPT4Messages_xx.properties where xx is the locale name. The locale name is defined by the current default locale or by the language property. The Type 4 driver is shipped with an error messages and status messages property file that contains the textual representation of errors and status messages for the English locale. The file is named HPT4Messages_en.properties.
4 Type 4 Driver Properties • • • “Summary of Type 4 Driver Properties” (page 35) “How to Specify JDBC Type 4 Properties” (page 38) “Type 4 Driver Property Descriptions” (page 40) Summary of Type 4 Driver Properties Type 4 driver properties that effect client-side operations are summarized in the following tables. For the detailed description, click the link provided in the property name.
Table 4-3 Operations on CLOB and BLOB Data Property Name Description Default Value blobTableName Specifies the LOB table for using BLOB columns. None clobTableName Specifies the LOB table for using CLOB columns. None reserveDataLocators Sets the number of data locators to be 100 reserved for a process that stores data in a LOB table.
Server-Side Properties Type 4 driver properties that effect server-side operations are summarized in the following tables. Unless otherwise noted in the description, the particular property applies to the DataSource object, DriverManager object, and ConnectionPoolDataSource object. Table 4-7 Type 4 Driver Server-Side Properties Property Name Description Default Value catalog Sets the default catalog used to access None SQL objects referenced in SQL statements if the SQL objects are not fully qualified.
How to Specify JDBC Type 4 Properties The Type 4 JDBC driver properties configure the driver. These properties can be specified in a data source, a connection URL (the primary IP address or host name on the Neoview SQL database), a properties file, or in the java command line. Java properties have the form: key=value At run time, the driver looks for a specific set of property keys and takes action based on their associated values.
Setting Properties in the Command Line When a Type 4 driver property is specified on the command line through the java -D option, the property must include the prefix: hpt4jdbc. This notation, which includes the period (.), ensures that all the Type 4 driver property names are unique for a Java application. For example, the maxStatements property becomes: -Dhpt4jdbc.
Type 4 Driver Property Descriptions The properties are listed in alphabetic order with their descriptions. For the properties summarized in categories, see “Summary of Type 4 Driver Properties” (page 35). blobTableName Property See “LOB Table Name Properties” (page 43). catalog Property The catalog property sets the default catalog used to access SQL objects referenced in SQL statements if the SQL objects are not fully qualified.
Set this property on the DataSource object. For information about how to set the property value, see “How to Specify JDBC Type 4 Properties” (page 38). Data type: String Default: none For example: dataSourceName=myDataSource description Property The description property specifies the registered source name. Set this property on a DataSource object, ConnectionPoolDataSource object, or DriverManager object. For information about how to set properties, see “How to Specify JDBC Type 4 Properties” (page 38).
Range: -1 to maxPoolSize • • Any negative value is treated as -1. Values can be less than minPoolSize, but must not exceed maxPoolSize. If the specified value is greater than maxPoolSize, the maxPoolSize property value is used. For example: initialPoolSize=10 ISO88591 Property The ISO88591 character-set mapping property corresponds to the Neoview SQL ISO88591 character set, which is a single- byte 8-bit character set for character data types.
language Property The language property sets the language used for the error messages. For more information about using this property, see “Localizing Error Messages and Status Messages” (page 32). Set this property on a DataSource object, ConnectionPoolDataSource object, or DriverManager object. For information about how to set properties, see “How to Specify JDBC Type 4 Properties” (page 38).
maxIdleTime Property The maxIdleTime property determines the number of seconds that a physical connection should remain unused in the pool before the connection is closed. 0 (zero) indicates no limit. Set this property on a DataSource object, ConnectionPoolDataSource object, or DriverManager object. For information about how to set properties, see “How to Specify JDBC Type 4 Properties” (page 38).
NOTE: Statement pooling can be in effect only if connection pooling is enabled. For example, to specify statement pooling, type: maxStatements=10 minPoolSize Property The minPoolSize property limits the number of physical connections that can be in the free connection pool. Set this property on a DataSource object, ConnectionPoolDataSource object, or DriverManager object. For information about how to set properties, see “How to Specify JDBC Type 4 Properties” (page 38).
password Property The password property sets the password value for passing to the NDCS server. By using this property, you can also change the password. The password is encrypted when it is passed to the server. The format for specifying the password is: password=old[,new,new] old new is the current password is the new password. Passwords must be 6 to 8 characters long and cannot contain double quotes (").
roundingMode Property The roundingMode property specifies the rounding behavior of the Type 4 driver. For example, if the data is 1234.127 and column definition is numeric(6, 2) and the application does setDouble() and getDouble(), the value returned is 1234.12, which is truncated as specified by the default rounding mode, ROUND_DOWN. Set this property on a DataSource object, ConnectionPoolDataSource object, or DriverManager object.
The serverDataSource allows the application to set Neoview SQL properties (such as resource governing) for server-side data sources. • • • If not specified, the default server data source is used. If the data source named in serverDataSource is not available on the Neoview platform, the default server data source is used. If the data source named in serverDataSource is not started on the Neoview platform, an SQLException is thrown.
Set this property on a DataSource object, ConnectionPoolDataSource object, or DriverManager object. For information about how to set properties, see “How to Specify JDBC Type 4 Properties” (page 38). Data type: String Default: OFF Logging Levels OFF SEVERE is a special level that turns off logging; the default setting. indicates a serious failure; usually applies to SQL exceptions generated by the Type 4 driver.
If the translationVerification property’s value is FALSE, and the driver is unable to translate all or part of an SQL statement; the translation is unspecified. In most cases, the characters that are untranslatable are encoded as ISO88591 single-byte question marks (? or 0x3F). No exception or warning is thrown. If the translationVerification property’s value is TRUE and the driver cannot translation all or part of an SQL statement or parameter, the driver throws an SQLException with this text.
5 Working with BLOB and CLOB Data This chapter 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 a Neoview database with support provided by the Type 4 driver. BLOB and CLOB are not native data types in a Neoview database.
LOB Architecture: Tables for LOB Data Support 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 by Using the Lob Admin Utility” (page 60). The JDBC applications that access BLOB or CLOB data must specify the associated LOB table names and, optionally, configure the reserveDataLocators property.
• • “Inserting CLOB Data by Using the PreparedStatement Interface” (page 53) “Inserting a Clob Object by Using the setClob Method” (page 54) Inserting CLOB Columns by Using the Clob Interface When you insert a row containing a CLOB data type, and before the column can be updated with real CLOB data, you can insert a row that has an empty CLOB value. To insert an empty CLOB value in a Neoview database, specify the EMPTY_CLOB() function for the CLOB column in the insert statement.
ASCII Data To insert a CLOB column using ASCII or MBCS data from an InputStream, use the PreparedStatement interface to insert the CLOB column. InputStream inputAsciiStream; PreparedStatement ps = conn.prepareStatement("insert into myTable (myClobColumn) values (?)"); ps.setAsciiStream(1, inputAsciiStream, length_of_data); ps.executeUpdate(); The Type 4 driver reads the data from InputStream and writes the data to the LOB table.
Make updates to CLOB data in the following ways: • • “Updating Clob Objects with the updateClob Method” (page 55) “Replacing Clob Objects” (page 55) Updating Clob Objects with the updateClob Method Unlike some LOB support implementations, the Type 4 driver updates the CLOB data directly in the database. So, when the Clob object is same in the updateClob method as the Clob object obtained using getClob, the updateRow method of the ResultSet interface does nothing with the Clob object.
NOTE: • The EMPTY_BLOB() function is an HP Neoview database software specific function and might not work on other databases. • Do not use the EMPTY_BLOB() function when using the PreparedStatement interface. Then, 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.
Reading Binary Data from a BLOB Column To read binary data from the BLOB column, use the Blob interface or InputStream. Using the Blob interface: // Obtain the Blob from ResultSet Blob myBlob = rs.getBlob("myBlobColumn"); // Obtain the input stream to read Blob data InputStream is = myBlob.getBinaryStream(); // read Blob data using the InputStream byte[] myBlobData; myBlobData = new byte[length]; is.
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 SQL Triggers to Delete LOB Data” (page 62). See also “NULL and Empty BLOB or Empty CLOB Value” (page 58).
6 Managing the SQL Tables for BLOB and CLOB Data This chapter describes for database administrators the creation and management of the tables required to support LOB data. NOTE: BLOB and CLOB are not native data types in a Neoview database. But database administrators can create SQL base tables that have BLOB and CLOB columns by using either the Type 4 driver or special SQL syntax in HP Neoview Script as described in this chapter.
1. Invoke the following command where Neoview Script is installed on the workstation. For the Windows workstation: > hpnvs.cmd For the Linux or UNIX workstation: > hpnvs.sh 2. Type this special command in Neoview Script to enable creating tables that have LOB columns: CONTROL QUERY DEFAULT JDBC_PROCESS 'TRUE'; 3.
Running the Lob Admin Utility Run the T4LobAdmin utility from the workstation. The format of the command is: java [java_options] com.hp.t4jdbc.T4LobAdmin [prog_options] [table_name] java_options The java_options should specify the Type 4 driver properties in a properties file on the java command line in the -D option. -Dhpt4jdbc.
Example 6-1 Type 4 Lob Admin Utility Help Hewlett-Packard T4 Lob Admin Utility 1.0 (c) Copyright 2004 Hewlett-Packard Development Company, LP. java [] com.hp.t4jdbc.T4LobAdmin [] [] is: [-Dhpt4jdbc.
For example, the following command generates the SQL statements to create the triggers for the base table sales.paris.pictures, which contains a BLOB column, and executes those statements. Note: This command must be typed on one line. java -Dhpt4jdbc.blobTableName=sales.paris.lobTable4pictures com.hp.t4jdbc.T4LobAdmin -trigger -exec sales.paris.
7 Type 4 Driver Compliance • • • • • • • • • • “Compliance Overview” (page 65) “Unsupported Features” (page 65) “Deviations” (page 67) “HP Extensions” (page 68) “Conformance of DatabaseMetaData Methods' Handling of Null Parameters” (page 69) “Type 4 Driver Conformance to SQL Data Types” (page 69) “Floating-Point Support” (page 71) “SQLJ Support” (page 71) “JDBC 3.
The particular ResultSet methods are not supported. ResultSet.getArray(int columnIndex) ResultSet.getArray(String columnName) ResultSet.getObject(int columnIndex, Map map) ResultSet.getObject(String columnName, Map map) ResultSet.getRef(int columnIndex) ResultSet.getRef(String columnName) ResultSet.getURL(int columnIndex) ResultSet.getURL(String columnName) ResultSet.updateArray(int columnIndex) ResultSet.updateArray(String columnName) ResultSet.updateRef(int columnIndex) ResultSet.
The following interfaces in the javax.sql package are not implemented in the Type 4 driver: Method Comments javax.sql.XAConnection Distributed Transactions, as described in the JDBC 3.0 API specification, are not yet implemented. javax.sql.XADataSource javax.sql.RowSet javax.sql.RowSetInternal javax.sql.RowSetListener javax.sql.RowSetMetaData javax.sql.RowSetReader javax.sql.RowSetWriter RowSet is not implemented in the HP JDBC Type 4 Driver.
java.sql.DatabaseMetaData.getVersionColumns() Mimics the DatabaseMetaData.getBestRowIdentifier() method because Neoview SQL does not support SQL_ROWVER (a columns function that returns the column or columns in the specified table, if any, that are automatically updated by the data source when any value in the row is updated by any transaction). java.sql.Connection.createStatement(...) The Type 4 driver does not support the scroll-sensitive java.sql.Connection.prepareStatement(...
public String getServiceName() throws SQLException Conformance of DatabaseMetaData Methods' Handling of Null Parameters This topic describes how the Type 4 driver determines the value of null parameters passed as a parameter value on DatabaseMetaData methods. Since other vendors might implement the JDBC specification differently, this information explains the Type 4 driver results on the affected queries. This implementation applies to methods that take parameters that can represent a pattern.
Types.DOUBLE Yes DOUBLE PRECISION Types.FLOAT Yes FLOAT(p) Types.INTEGER Yes INTEGER Types.JAVA_OBJECT No N. A. Types.LONGVARBINARY Data type is mapped by Neoview SQL. Data type VARCHAR(n)¹ varies from that used for table creation. Types.LONGVARCHAR Yes VARCHAR[(n)] Maximum length is 4018. Types.NULL No N. A. Types.NUMERIC Yes NUMERIC(p,s) Types.REAL Yes FLOAT(p) Types.REF No N. A. Types.SMALLINT Yes SMALLINT Types.STRUCT No N. A. Types.TIME Yes TIME Types.
INTERVAL MINUTE(p) TO SECOND INTERVAL SECOND(p) Floating-Point Support The Type 4 driver supports only IEEE floating-point data to be passed between the application client and the Type 4 driver. SQLJ Support The Type 4 driver supports non-customized SQLJ applications, but does not support customized SQLJ applications. JDBC 3.0 Features Not Supported by the Type 4 Driver These features are not required for JDBC 3.0 compliance, and they are not supported by the HP JDBC Type 4 driver.
8 Tracing and Logging Facilities The Type 4 driver provides two tracing and logging facilities: • • Standard JDBC tracing and logging functionality as defined by the JDBC standard Type 4 driver logging facility Server-side tracing (logging) is enabled by configuring the HP connectivity service. For more information, see the Neoview DB Admin online help.
Accessing the Type 4 Driver Logging Facility The Type 4 Driver Logging facility is based on the java.util.logging package. The Type 4 driver instantiates a java.util.logging.Logger class and names the logger com.hp.t4jdbc.logger. Your JDBC program can access the Type 4 driver logger directly by calling the java.util.logging.Logger static method getLogger(String). For example String t4Logger = java.util.logging.Logger.getLogger(“com.hp.t4jdbc.
NOTE: The tilde (~) character separates message parts. This separator allows you to format the message using tools, such as Excel, Word, UNIX sort, and so forth. For example, you can format and sort messages based on sequence number or thread ID. You can edit the log file and change the separator (the tilde) to any character you want. When possible, numbers (such as thread-id and sequence-number) are prepended with zeros (0) to allow for readable formatting.
9 Messages About the Message Format Messages are listed in numerical SQLCODE order. Descriptions include: SQLCODE SQLSTATE message-text Cause [ What occurred to trigger the message.] Effect [ What is the result when this occurs. ] Recovery [ How to diagnose and fix the problem. ] Contacting Your Service Provider Some messages have no recovery information and are instructed to contact the Global Mission Critical Solution Center (GMCSC).
Cause Connection with server has been lost. Server is now connected to a different connection. Effect Recovery Operation fails. Reconnect. 29001 HYC00 29001 HYC00 Unsupported feature - {0} Cause Effect Recovery The feature listed is not supported by the JDBC driver. An unsupported exception is thrown, and null resultSet is returned. Remove the feature functionality from the program.
29007 07009 29007 07009 Invalid descriptor index Cause A ResultSetMetadata column parameter or a ParameterMetaData param parameter is outside of the descriptor range. Effect The ResultSetMetadata or ParameterMetaData method data is not returned as expected. Recovery Validate the column or parameter that is supplied to the method. 29008 24000 29008 24000 Invalid cursor state Cause Effect The ResultSet method was called when the connection was closed. The method call does not succeed.
Cause The size set for ResultSet.setFetchSize rows to fetch is less than zero. Effect The number of rows that need to be fetched from the database when more rows are needed for a ResultSet object is not set. Recovery Set the setFetchSize() method rows parameter to a value greater than zero. 29015 HY024 29015 HY024 Invalid fetch direction Cause The setFetchDirection() method direction parameter is set to an invalid value.
Recovery Informational message only; no corrective action is needed. Valid Object Types are: null, BigDecimal, Date, Time, Timestamp, Double, Float, Long, Short, Byte, Boolean, String, and byte[], Blob, and Clob. 29022 HY010 29022 HY010 Function sequence error Cause The PreparedStatement.execute() method does not support the use of the PreparedStatement.addBatch() method. Effect An exception is reported; the operation is not completed. Recovery Use the PreparedStatement.executeBatch() method.
29033 23000 29033 23000 Primary key column value can't be updated Cause Effect An attempt was made to update the primary-key column in a table. 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. 29035 HY000 IO Exception occurred {0} message_text Cause An ASCII or Binary or Character stream setter or an updater method resulted in a java.io.IOException.
29040 HY000 29040 HY000 Operation invalid. Current row is the insert row Cause An attempt was made to retrieve update, delete, or insert information on the current insert row. Effect The ResultSet row information retrieval does not succeed. Recovery To retrieve row information, move the ResultSet object cursor away from the insert row. 29041 HY000 29041 HY000 Operation invalid.
Cause A value retrieved from the ResultSet getter method is outside the range for the data type. Effect The ResultSet getter method does not retrieve the data. Recovery Make sure the data to be retrieved is within a valid data-type range. 29047 HY000 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.
29054 HY000 29054 HY000 Only SQL SELECT statements are valid in executeQuery() method Cause Effect Recovery A non-select SQL statement was used in the executeQuery() method. The exception reported is "SQL query not performed". Use the executeUpdate() method to issue the non-select SQL statement. 29056 HY000 29056 HY000 Statement is already closed Cause A validateSetInvocation() or validateExecuteInvocation method was used on a closed statement.
29061 HY00 29061 HY00 Lob object {0} is not current Cause Attempted to access LOB column data after the cursor moved or the result set from which the LOB data was obtained had been closed. Effect The application cannot access LOB data. Recovery Read the LOB data before moving the cursor or closing the result-set object.
29102 HY000 29102 HY000 Error while parsing address address Cause Effect Recovery The address format was not recognized. Operation fails. Refer to “url Property” (page 50) for the valid address format. 29103 HY000 29103 HY000 Address is null Cause Effect Recovery The address was empty. Operation fails. Refer to “url Property” (page 50) for the valid address format. 29104 HY000 29104 HY000 Expected suffix: suffix Cause Effect Recovery The address suffix was incorrect or missing. Operation fails.
Cause Effect Informational message. N. A. Recovery N. A. 29110 HY000 29110 HY000 Address is missing an IP address or machine name. Cause Effect An IP address or machine name is required, but missing. The operation fails. Recovery Include a valid IP address or machine name. Refer to “url Property” (page 50) for the valid address format. 29111 HY000 29111 HY000 Unable to evaluate address address Cause: cause Cause Effect The driver could not determine the IP address for a host. The operation fails.
29116 HY000 29116 HY000 Socket is closed. Cause Socket close error. Effect The operation fails. Recovery Evaluate the returned value from the getCause method on the Exception to determine the appropriate recovery action. 29117 HY000 29117 HY000 Error while closing session. Cause: cause Cause Effect An error was encountered while closing a session. The operation fails. Recovery Evaluate the returned value from the getCause method on the Exception to determine the appropriate recovery action.
29123 HY000 29123 HY000 An execute call message error occurred. Cause: cause Cause Effect Unable to perform this operation. Operation fails. Recovery Evaluate the returned value from the getCause method on the Exception to determine the appropriate recovery action. 29124 HY000 29124 HY000 An execute direct message error occurred. Cause: cause Cause Effect Unable to perform this operation. Operation fails.
Recovery Evaluate the returned value from the getCause method on the Exception to determine the appropriate recovery action. 29130 HY000 29130 HY000 A get sql catalogs message error occurred. Cause: cause Cause Effect Unable to perform this operation. Operation fails. Recovery Evaluate the returned value from the getCause method on the Exception to determine the appropriate recovery action. 29131 HY000 29131 HY000 An initialize dialogue message error occurred.
29136 HY000 29136 HY000 An association server connect reply occurred. Exception: exception Exception detail: exception_detail Error text/code: error text_or_code Cause Effect Unable to perform this operation. Operation fails. Recovery Evaluate any error or error detail information accompanying this message and contact the GMCSC to check logs for server (Neoview platform) errors and to analyze accompanying errors and warnings. 29137 HY000 29137 HY000 A close reply error occurred.
Cause Effect Unable to perform this operation. Operation fails. Recovery Evaluate the returned value from the getCause method on the Exception to determine the appropriate recovery action. 29143 HY000 29143 HY000 An execute rowset reply error occurred. Cause Effect Unable to perform this operation. Operation fails. Recovery Evaluate the returned value from the getCause method on the Exception to determine the appropriate recovery action. 29144 HY000 29144 HY000 A fetch perf reply error occurred.
29149 HY000 29149 HY000 A prepare rowset reply error occurred. Cause Effect Unable to perform this operation. Operation fails. Recovery Evaluate the returned value from the getCause method on the Exception to determine the appropriate recovery action. 29150 HY000 29150 HY000 A set connection option reply error occurred. Cause Effect Unable to perform this operation. Operation fails.
Recovery Contact the GMCSC to check logs for server (Neoview platform) errors and to analyze errors and warnings. 29156 HY000 29156 HY000 An error was returned from the server. Error: error Error detail: error_detail Cause Effect The server reported an error. Operation fails. Recovery Evaluate any error or error detail information accompanying the message. Contact the GMCSC to check logs for server (Neoview platform) errors and to analyze accompanying errors and warnings.
29162 S1000 29162 S1000 Unexpected programming exception has been found: exception. Check the server event log on node node for details. Cause Effect A message returned by the server. Operation fails. Recovery Contact the GMCSC to check logs for server (Neoview platform) errors and to analyze accompanying errors and warnings. 29163 08001 29163 08001 ODBC Services not yet available: server Cause Effect A message returned by the server. Operation fails.
29169 HY000 29169 HY000 Invalid connection property setting Cause Effect The message returned by the server was too short to be a valid message. Operation fails. Recovery None. Contact the GMCSC and report the entire message. 29170 HY000 29170 HY000 Invalid parameter value Cause Internal error. Effect Operation fails. Recovery None. Contact the GMCSC and report the entire message. 29172 HY000 29172 HY000 Translation of parameter to {0} failed.
Effect The operation fails. Recovery Contact the GMCSC to check logs for server (Neoview platform) errors regarding the NDCS server. 29178 HY000 29178 HY000 No column value has been inserted. Cause Effect The value for a required column was not specified. Operation fails. Recovery Ensure that all required column values are specified, and retry the operation. 29182 HY000 29182 HY000 General warning.
A Sample Programs Accessing CLOB and BLOB Data This appendix shows two working programs. Sample Program Accessing CLOB Data This sample program shows operations that can be performed through the Clob interface or through the PreparedStatement interface. The sample program shows examples of both interfaces taking a variable and putting the variable's value into a base table that has a CLOB column. // LOB operations can be performed through the Clob interface, // or the PreparedStatement interface.
// Set hpt4jdbc.clobTableName System Property. This property // can also be added to the command line through // "-Dhpt4jdbc.clobTableName=...", or a // java.util.Properties object can be used and passed to // getConnection. System.setProperty( "hpt4jdbc.clobTableName","cat.sch.clobdatatbl" ); if (args.length < 2) { System.out.println("arg[0]=; arg[1]=file; arg[2]="); return; } String k = "K"; for (int i=0; i<5000; i++) k = k + "K"; System.out.println("string length = " + k.
catch (SQLException e) { e.printStackTrace(); SQLException next = e; do { System.out.println("Messge : " + e.getMessage()); System.out.println("Error Code : " + e.getErrorCode()); System.out.println("SQLState : " + e.getSQLState()); } while ((next = next.getNextException()) != null); } // 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.
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 through 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.
if (args.length < 2) { System.out.println("arg[0]=; arg[1]=file; arg[2]="); return; } // byte array for the blob byte[] whatever = new byte[5000]; for (int i=0; i<5000; i++) whatever[i] = 71; // "G" String k = "K"; for (int i=0; i<5000; i++) k = k + "K"; System.out.println("string length = " + k.length()); java.io.ByteArrayInputStream iXstream = new java.io.ByteArrayInputStream(whatever); numBytes = iXstream.available(); if (args.length == 3) numBytes = Integer.parseInt(args[2]); recKey = Integer.
} while ((next = next.getNextException()) != null); } // Blob interface example - This technique is suitable when // the LOB data is already in the app, such as having been // transfered in a msgbuf. try { // insert a second base table row with empty LOB column System.out.println("BLOB interface LOB insert..."); String stmtSource2 = "insert into blobtiff values (?,EMPTY_BLOB())"; PreparedStatement stmt2 = conn1.prepareStatement(stmtSource2); stmt2.setInt(1,recKey+1); stmt2.
B Avoiding Driver-Server Version Mismatch The HP Neoview JDBC type 4 driver, version R2.2, described in this document can connect only with an HP Neoview R2.2 platform (server). It cannot connect with an R2.1 earlier version platform To make a connection with the Neoview platform, JDBC clients, through the driver, connect with the Neoview database connectivity service (NDCS) on the Neoview platform. In some situations, HP JDBC clients need to make connections to Release 2.2 and R2.
Unexpected programming exception has been found: errortext. Check the server event log on node logfile_location for details. is the error text from the server. errortext is the location of the log file. logfile_location Additional error text returned only by a Release 2.2 server, but displayed by any version driver: Version Mismatch: Client Version is: Pre R2.2.0 Server Version is: R2.2.
Glossary 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.
command The operation demanded by an operator or program; a demand for action by, or information from, a subsystem. A command is typically conveyed as an interprocess message from a program to a subsystem. connection pooling A framework for pooling JDBC connections. D Data Manipulation Language (DML) The set of data-manipulation statements within the SQL language. These statements include INSERT, DELETE, and UPDATE, which cause database modifications.
interface In general, the point of communication or interconnection between one person, program, or device and another, or a set of rules for that interaction. See also API. International Organization for Standardization (ISO) A voluntary, nontreaty organization founded in 1946, responsible for creating international standards in many areas, including computers and communications. Its members are the national standards organizations of 89 countries, including ANSI.
node One of the following: • An addressable device attached to a computer network. • A hypertext document. O ODBC See Open Database Connectivity (ODBC). Open Database Connectivity (ODBC) The standard Microsoft product for accessing databases. 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.
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.
Index A Abbreviations in this manual, 14 Access considerations Blob and Clob objects, 58 Neoview SQL databases, 21 Appendix A, 99 Architecture for LOB support, 51 ASCII data PreparedStatement interface, 54 reading, 54 Audience, 11 Authentication, 22 Autocommit mode, 58 Avoiding driver-server version mismatch, 105 B Base table creating, 59 illustrated, 51 specifying for Lob Admin utility, 61 Binary data reading, 57 writing, 56 BLOB columns associated LOB table, 52 creating through JDBC programs, 60 creating
ConnectionPoolDataSource interface client-side, 21 setting properties, 38 Connections connectionTimeout property, 40 loginTimeout property, 43 maxIdleTime property, 44 connectionTimeout property, 40 CONTROL QUERY command, 60 create option, 61 CREATE TABLE statement base tables, 59 with ISO88591 column, 32 Creating base tables through JDBC, 60 base tables through Neoview Script, 59 base tables with LOB columns, 59 data source, 23 LOB tables, 62 localized-message file, 33 Current Blob or Clob object, 58 Where
HPT4DatabaseMetaData class, 68 hpt4jdbc.jar, 19 HPT4Messages_en.
MetaData DatabaseMetaData API extensions, 68 DatabaseMetaData method conformance, 69 minPoolSize property, 45 N Neoview platform version, 105 Neoview Script (see HP Neoview Script) Neoview SQL, 17 (see also SQL) character sets, 31 data types, 69 recompilation, 28 networkTimeout property, 45 Notation conventions, 12 Null parameters, 69 O Options, Lob Admin utility, 61 out option, 61 OutputStream current object, 58 P password authentication, 22 property, 46 Pooling, 35 (see also Connection pooling) enablin
loginTimeout property, 43 maxIdleTime property, 44 networkTimeout property, 45 Tracing facilities, 73 properties for, 36 standard facilities, 73 Transactions Blob and Clob access, 58 translationVerification property, 49 trigger option, 61 Triggers deleting LOB data, 62 generating SQL statements, 61 Troubleshooting logging, 49 statement pooling, 28 Truncation, controlling, 47 Tutorial on JDBC, 22 Type 4 driver compliance, 65 downloading, 19 error messages, 77 extension to JDBC 3.