Neoview ODBC Drivers Manual (R2.2 SP1)
Table Of Contents
- HP Neoview ODBC Drivers Manual
- Table of Contents
- About This Document
- 1 HP Neoview ODBC Driver Overview for Windows
- 2 HP Neoview ODBC Drivers Overview for Linux, HP-UX, IBM AIX®, and Sun Solaris
- 3 Installing the HP Neoview ODBC Drivers
- Installing ODBC Client Software
- Avoiding Driver-Platform Version Incompatibility
- Installing the HP Neoview ODBC Driver for Windows
- Reinstalling the HP Neoview ODBC Driver for Windows
- Uninstalling the HP Neoview ODBC Driver for Windows
- Setting Up the Client Environment
- Troubleshooting
- Getting the Version of the Driver
- ODBC API Reference
- Installing or Reinstalling HP Neoview ODBC Drivers for Linux, HP-UX, IBM AIX®, and Sun Solaris
- Setting Up the Client Environment
- Running the Sample Program
- Troubleshooting
- Debugging
- Getting the Version of the Driver
- ODBC API Reference
- 4 Configuring Client Data Sources
- 5 HP Neoview ODBC Drivers Conformance
- 6 HP Neoview ODBC Drivers Messages
- Index

4. Specify the ODBC version.
Call SQLSetEnvAttr and set the SQL_ATTR_ODBC_VERSION attribute to the application
version (for example, SQL_OV_ODBC3).
5. Allocate a connection handle.
Call SQLAllocHandle with the HandleType argument set to SQL_HANDLE_DBC, and the
InputHandle argument set to the environment handle allocated for connection pooling.
6. Make the connection.
Call SQLConnect or SQLDriverConnect. The driver manager uses the connection options
and the SQL_ATTR_CP_MATCH attribute to determine which connection in the pool to
assign to the application.
7. Set connection attributes.
Call SQLSetConnectAttr to set these attributes if necessary:
• SQL_ATTR_TXN_ISOLATION (default: SQL_TXN_READ_COMMITTED)
• SQL_ATTR_ACCESS_MODE (default: SQL_MODE_READ_WRITE)
• SQL_ATTR_AUTOCOMMIT (default: SQL_AUTOCOMMIT_ON)
An application, however, cannot change the schema using an ODBC API function. If more
than one user wants to create objects in the same schema, set the schema to USR (the default)
using the Microsoft ODBC Administrator.
8. Retrieve and process data from the database.
When using connection pooling, an application must preserve the database context within
the session and should not execute SQL statements that change the name of the database or
its context.
9. Disconnect and return the connection to the connection pool.
Call SQLDisconnect.
NOTE: If a transaction is pending when an application calls SQLDisconnect and
SQL_ATTR_AUTOCOMMIT is set to SQL_AUTOCOMMIT_OFF, the ODBC driver returns
SQLSTATE 25000 (Invalid transaction state). The application must then explicitly commit
or roll back the transaction, and then disconnect.
10. Free the environment and connection handles.
Call SQLFreeHandle for each handle.
For detailed information about connection pooling and the ODBC API functions, refer to:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconconnectionpoolingforsqlservernetdataprovider.asp.
Configuring the Client Data Source on Linux, HP-UX, IBM AIX®, and Sun
Solaris
The install.sh script creates the data source configuration file MXODSN.template in the
/etc/hpodbc directory. Rename MXODSN.template to MXODSN and make the necessary
changes.
Setting Trace On
By default, trace is set OFF. To set trace ON, set the flag TraceStart to 1. For example,
TraceStart = 1.
[ODBC]
traceFlags = INFO
TraceStart = 1 A value of 0 will set trace OFF
TraceFile = TRLOG
48 Configuring Client Data Sources