Neoview JDBC Type 4 Driver Programmer's Reference (R2.2, R2.3, R2.4, R2.5)
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 ... Where Current of" Operations” (page 29)
• “INFOSTATS Command for Obtaining Query Costs” (page 29)
• “Internationalization Support” (page 31)
• “Localizing Error Messages and Status Messages” (page 32)
Data Sources
The term data source logically refers to a database or other data storage entity. In this manual,
two concepts of data source concepts apply:
• A JDBC (client) data source, which is physically a Java object that contains properties such
as the URL of the physical database, the catalog to use when connecting to this database,
and the schema to use when connecting to this database. The JDBC data source also contains
methods for obtaining a JDBC connection to the underlying database.
• A server data source that is physically a set of information that is created and managed by
Neoview Database Connectivity Service (NDCS). This data source contains configuration
information, which defines the semantics of connectivity servers created with that server
data source.
JDBC Data Source (client-side)
All JDBC data source classes implement either the javax.sql.DataSource interface or the
javax.sql.ConnectionPoolDataSource interface. The Type 4 driver data source classes
are com.hp.t4jdbc.HPT4DataSource and
com.hp.t4jdbc.HPT4ConnectionPoolDataSource. (These classes are defined by the JDBC
3.0 specification.)
Typically, a user or system administrator uses a tool to create a data source, and then registers
the data source by using a JNDI service provider. At run time, a user application typically retrieves
the data source through JNDI, and uses the data source’s methods to establish a connection to
the underlying database.
A DataSource object maps to an instance of a database. In the Type 4 driver product, the
DataSource object acts as an interface between the application code and the database and
enables connection with an NDCS data source.
Server Data Source
Server data sources reside in the Neoview platform. Each server data source represents a pool
of connectivity service servers that share the same Neoview SQL context. A server data source
is typically created by a system administrator, who defines the semantics of all connections made
through that server data source. For example, the server data source contains information on
how many servers can be in its corresponding pool and how many connections can be handled
through this data source.
Data Sources 21