
SOLID JDBC Driver Samples
This directory contains the following
java samples:
Each sample is briefly
described below.
For setting up an
environment for running the samples, please view the
installation instructions.
For more information about
using JDBC with SOLID Server, please view SOLID JDBC
Driver Programmer's Guide.
Sample1: Connecting to SOLID Server and
executing a simple select
1. Registers the driver using JDBC driver
manager services
2. Prompts the user for a valid JDBC connect string
3. Connects to SOLID Server using the driver
4. Creates a statement for one query,
'SELECT TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE FROM TABLES'
for reading data from one of SOLID Server's
system tables.
5. Executes the query
6. Fetches and outputs all the rows of a result set.
7. Closes connection
Files related to Sample1:
sample1.java |
Java source code. |
sample1.txt |
Java source as text. Allows viewing without
side effects. |
sample1.class |
Compiled bytecode. Ready to run if CLASSPATH
is set. |
sample1_out.txt |
Sample output when run against an empty
database. |
Sample2:
Simple applet example: submitting ad-hoc SQL queries.
1. Registers the driver using JDBC driver
manager services
2. Connects to SOLID Server using the driver.
Used url is read from sample2.html
3. Executes given SQL statements
Files related to Sample2:
sample2.html |
HTML page for calling the applet. Ready to
run with appletviewer or with a browser
environment supporting Java 1.1 API. |
sample2.java |
Java source code. |
sample2.txt |
Java source as text. Allows viewing without
side effects. |
sample2.class |
Compiled bytecode. Called by sample2.html. |
Sample3:
Database procedure example.
1. Registers the driver using JDBC driver
manager services
2. Prompts the user for a valid JDBC connect string
3. Connects to SOLID Server using the driver
4. Drops and creates a procedure sample3. If the
procedure does not exist dumps the related exception.
5. Calls that procedure using java.sql.Statement
6. Fetches and outputs all the rows of a result set.
7. Closes connection
Files related to Sample3:
sample3.java |
Java source code. |
sample3.txt |
Java source as text. Allows viewing without
side effects. |
sample3.class |
Compiled bytecode. Ready to run if CLASSPATH
is set. |
Sample4:
BLOb usage example.
1. Registers the driver using JDBC driver
manager services
2. Prompts the user for a valid JDBC connect string
3. Connects to SOLID Server using the driver
4. Drops and creates a table sample4. If the table does
not exist dumps the related exception.
5. Inserts the file given as argument to database (method
Store)
6. Reads this 'BLOb' back to file out.tmp (method
Restore)
7. Closes connection
Files related to Sample4:
sample4.java |
Java source code. |
sample4.txt |
Java source as text. Allows viewing without
side effects. |
sample4.class |
Compiled bytecode. Ready to run if CLASSPATH
is set. |

Company | Products | Support | Search | Free Eval Packs
Copyright © 1992-1997 Solid Information Technology Ltd.
All rights reserved.
|