HP Driver for JDBC User's Manual
81
D Simple Client Source Code
The Java source listing given in this appendix is a program
demonstrating the use of HP Driver for JDBC to access an
ALLBASE/SQL or IMAGE/SQL database. It can be run from any
platform which has JDK 1.1 (or above) and HP Driver for JDBC
installed. This program is part of the HP Driver for JDBC distribution
and it is named SimpleClient.java.
/**
* JDBC Simple Client
*
* This simple Java application loads a JDBC Driver, prompts the
* user for connection information, creates the Driver URL, makes
* the connection to the database, and sends user provided SQL
* statements to the database.
*
* If the result of the statement is a result set, it is printed
* out.
*
* This code and information is provided "as is" without warranty
* of any kind, either expressed or implied.
*
*/
import java.io.*;
import java.net.URL;
import java.sql.*;
class SimpleClient
{
private static Connection con = null;
private static Statement stmt = null;
/**
* Command: java SimpleClient
*/
public static void main(String args[])