HPlogo ALLBASE/SQL Release G3.37 Release Notes: HP 9000 Computer Systems > Chapter 2  What is Contained in Version G3.37?

Features

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

The following features are contained in G3.37 and later releases.

HP Driver for JDBC (G3.14)

Java Database Connectivity (JDBC) is a standard Application Programming Interface (API) for database access from Java. HP Driver for JDBC is an implementation of the standard JDBC API. It consists of HP's fully-java Driver for JDBC, network protocol and database server interface components for concurrent access to IMAGE/SQL and
ALLBASE/SQL databases.

HP JDBC Components

There are three components supplied with the HP JDBC product, the JDBC Driver, the JDBC Monitor, and the JDBC Server.

The Driver is a set of Java classes that implement the java.sql.* interfaces and provide an implementation of a JDBC driver that can communicate with an ALLBASE/SQL or IMAGE/SQL database. The HP Driver for JDBC typically will reside on the client side of the user application. It provides the translation from the Java language and the JDBC API to the HP proprietary network protocol.

The JDBC Monitor is a component that is installed on the JDBC server host that manages all client JDBC Driver connections to the server host. It is typically started as a daemon when the server machine is booted. All JDBC client connections are made through the JDBC Monitor. The monitor performs validation of the userid and password that are passed in the client connection request and spawns JDBC Server processes to serve each of the client connections. Once the server process is spawned, the monitor returns to wait for the next client connection.

The JDBC Server is the server process that is spawned by the JDBC Monitor to service a client connection. It handles the translation from the HP proprietary network protocol to the ALLBASE/SQL calls. There is at least one JDBC Server process for each client connection to the server host. More than one JDBC Server process may be used to handle multiple client statements using the same connection. This component also handles the translation from JDBC SQL to ALLBASE SQL and conversion of the database data from ALLBASE/SQL format to JDBC format.

Both the JDBC Monitor and the JDBC Server must be installed on the same host where the ALLBASE/SQL databases reside.

Java Requirements

The HP JDBC Client components (the JDBC driver itself) requires a Java Development Kit (JDK) version 1.1 and above, which includes JDBC version 1.2. Java and JDK components need to be installed only on the client platform. The JDBC server platforms use native components and must be installed on the same host where the ALLBASE/SQL databases reside.

HP-UX Server Requirements

The HP JDBC Server components require HP-UX version 10.20 or greater.

ALLBASE/SQL Requirements

The HP JDBC Server components require ALLBASE/SQL G3.01 or greater.

Documentation

For more details about installation and use of JDBC, refer to HP Driver for JDBC Users' Manual.

G3 Release Enhancements

The remainder of this chapter provides information about enhancements from earlier releases.

String Functions

With the G3 release of ALLBASE/SQL and IMAGE/SQL, the supported SQL syntax has been enhanced to include the following string manipulation functions: UPPER, LOWER, POSITION, INSTR, TRIM, LTRIM and RTRIM. These string functions allow you to manipulate or examine the CHAR and VARCHAR values within the SQL syntax, allowing for more sophisticated queries and data manipulation commands to be formed. These string functions were designed to be compatible with functions specified in the ANSI SQL '92 standard and functions used in ORACLE. In cases where the ANSI SQL '92 standard and the ORACLE functions were not compatible (such as the LTRIM and RTRIM in ORACLE versus TRIM in the ANSI standard), both versions were implemented. The specifications for each of these functions follows.

Function Specification

LOWER

Converts all the characters in stringexpr to lower case

Syntax

[LOWER (stringexpr)]

UPPER

Converts all the characters in stringexpr to upper case

Syntax

[UPPER (stringexpr)]

POSITION

Searches for the presence of the string stringexpr1 in the string stringexpr2 and returns a numeric value that indicates the position at which stringexpr1 is found in stringexpr2

Syntax

[POSITION (stringexpr1, stringexpr2)]

INSTR

Searches stringexpr1 beginning with its nth character for the mth occurrence of stringexpr2 and returns the position of the character in stringexpr1 that is the first character of this occurrence. If n is negative, Instr counts and searches backward from the end of stringexpr1. The value of m must be positive. The default values of both n and m are 1, meaning Instr begins searching at the first character of stringexpr1 for the first occurrence of stringexpr2. The return value is relative to the beginning of stringexpr1 regardless of the value of n, and is expressed in characters. If the search is unsuccessful (if stringexpr2 does not appear m times after the nth character of stringexpr1) the return value is 0.

If n and m are not specified the function is equivalent to the ANSI SQL-92 POSITION function, except that the syntax is slightly different.

Syntax

[INSTR (stringexpr1, stringexpr2 [,n [,m]])]

LTRIM

LTRIM function trims the characters specified in charset from the beginning of the string stringexpr.

Syntax

[LTRIM (charset, stringexpr)]

RTRIM

RTRIM function trims the characters specified in charset from the end of the string stringexpr.

Syntax

[RTRIM (charset, stringexpr)]

TRIM

TRIM function allows you to strip the characters specified in charset from the beginning and/or the end of the string stringexpr. If charset is not specified, then blank characters would be stripped from stringexpr.

Syntax

[ TRIM ({ LEADING | TRAILING | BOTH} (,charset ,stringexpr)]

Examples:

Example 1
 SELECT LOWER (OWNER) || '.' || LOWER (NAME)
FROM SYSTEM.TABLE
WHERE NAME = UPPER ('vendors');

Returns "purchdb .vendors "

Example 2
 SELECT POSITION ('world', 'hello world')
FROM SYSTEM.TABLE
WHERE NAME = UPPER('vendors');

Returns the numeric value 7

Example 3
 SELECT INSTR ('hello world hello world', 'world', 5, 2)
FROM SYSTEM.TABLE
WHERE NAME = UPPER('vendors');

Returns the numeric value 18 (starting position of the second occurrence of the string 'world')

Example 4
 SELECT * FROM SYSTEM.TABLE
WHERE NAME = LTRIM ('?*', 'VENDORS?*???***')
AND OWNER = 'PURCHDB';

Returns the system table entry for PURCHDB.VENDORS

Example 5
 SELECT TRIM (BOTH '?*' FROM '??**?*hello ?* world???*')
FROM SYSTEM.TABLE
WHERE NAME = 'VENDORS';

Returns 'hello ?* world'.

Feedback to webmaster