This article looks at programmatic
Interfaces provided by the Oracle 8i Server for
Java Development. Oracle offers JDBC ( Java Database
Connectivity API ) and SQLJ ( Java PreCompiler API
) Interfaces.
JDBC Drivers
JDBC is a standard way of
connecting to databases from Java. This is comparable
to ODBC in Windows. The initial versions of JDBC
Drivers were JDBC-ODBC Bridges and then native drivers
were created to provide cross platform compatibility..
In addition to the standard JDBC API, Oracle drivers
have extensions to support properties, types, and
performance
Oracle offers 3 versions
of the driver with Oracle 8i. Thin JDBC Driver,
OCI JDBC Driver and the Server JDBC Driver.
Thin JDBC Driver is meant
for applets etc. This driver uses Java Sockets to
establish connection with the database and does
not need any client libraries to connect to the
database. This driver is around 150K and can be
automatically downloaded along with the Java Applet.
OCI JDBC Driver is meant
for middleware developers who want to take advantage
of the DBMS specific features. This driver needs
the client OCI Libraries installed on the client
or on the Middleware Server in a thin client environment.
JDBC calls are translated into OCI calls which are
sent via Net8 to the DBMS Server. This cannot be
automatically downloadedand has to be installed
on the client or the application server.
Server JDBC Driver resides
inside the database and provides faster access to
the database when using Java Stored Procedures etc.
This driver conforms to SUN JDBC Specification.
The server side and and client side API are the
same and this gives an added flexibility of deploying
applications within the database or on the client.
This JDBC Driver has additional features to support
Oracle Stored Procedures, Oracle Specific Data Types,
NLS Character Sets etc.
SQLJ
SQLJ Translator works just
like the pro* precompilers of oracle. Oralce Provides
both a client and server version of SQLJ Translator.
SQLJ enables SQL Statements to be embedded into
Java Programs and the code is simple, concise and
easier to write than JDBC.It also features Static
Analysis and Type Checking.
SQLJ Translator takes a
java source file with embedded sql statements and
translates SQLJ clauses into Java Class Definitions
that implement the SQL Statements. The server-side
SQLJ Translator is a highly optimized SQLJ translator
that runs directly inside the database server and
it provides runtime access to Oracle via the Server
JDBC Driver. SQLJ Code can include DML. DDL, Transaction
Control, and Store Procedure Calls.
DBAsupport.com Home Page