JDBC Driver for SQL/MP 3.0
In the Data Manipulation Language (DML):
DECLARE CURSOR
DELETE
INSERT
SELECT
UPDATE
Substitution also works on subqueries.
The alias substitution mechanism does not substitute Guardian file names and Guardian DEFINEs. If your SQL query
uses a DEFINE, you cannot use this alias substitution mechanism.
In this example, no alias substitution is possible:
select =jobcode, =deptnum, =first_name, =last_name from persnl.employee
where =jobcode > 500 and =deptnum <= 3000 order by =jobcode browse access
In this example of a nested statement, the candidates for substitution are printed in bold type:
update employee set salary = salary*1.1
where deptnum in (select deptnum from dept where location = "San Francisco")
In this example, the candidates for substitution are printed in bold type. Candidates include the correlation names, o
and p, because they can be user-defined names that can be replaced by Guardian table names (such as parts).
select ordernum,
sum(qty_ordered*price) from parts p, odetail o
where o.partnum = parts.partnum
and ordernum in (select ordernum from orders o, customer c
where o.custnum = c.custnum and state = "CALIFORNIA" group by ordernum)
Note: Mapping parts to a fully qualified Guardian name (such as $sys1.vol.subvol.parts) results in
an invalid SQL statement because the substitution procedure also replaces the second occurrence of parts.
To check the effect of alias substitution during development, use the SQLMPConnection.nativeSQL(String str)
function. This function returns the SQL statement that results from performing alias substitutions on the SQL statement
str.
Connection Pooling and the Application Server
Usually, in a three-tier environment, the application server implements the connection-pooling component. How to
implement this component is described in these topics:
Guidelines for Implementing an Application Server to Use Connection Pooling
Standard ConnectionPoolDataSource Object Properties
Registering the ConnectionPoolDataSource and DataSource with a JNDI-Based Name Service
Guidelines for Implementing an Application Server to Use Connection
Pooling
The application server maintains a cache of the PooledConnection objects created by using the
ConnectionPoolDataSource interface. When the client requests a connection object, the application looks for