Full HTML for

Basic foilset Overview of Approaches to Java - Database Connectivity

Given by Konrad Olszewski at Rome Lab Quarterly Review for CIV on June 28 96. Foils prepared 23 February 97
Outside Index Summary of Material


This talk contrasts 4 approaches to Linking Java to Databases
JDBC -- Java Database Connection
Oracle Web Server
WebLogic products
Netscape LiveWire

Table of Contents for full HTML of Overview of Approaches to Java - Database Connectivity

Denote Foils where Image Critical
Denote Foils where HTML is sufficient

1 Java - Database Connectivity
2 Covered products
3 Motivation
4 Traditional Web/RDBMS Configuration
5 What's new with Java ?
6 JDBC - main features
7 JDBC scheme
8 Two tier vs. three tier
9 Driver Manager
10 Main classes
11 Metadata
12 Example of use
13 Oracle Web Server
14 Example of use
15 Principle of operation
16 Couldn't it be better?
17 Comparison of two approaches
18 WebLogic
19 WebLogic libraries
20 WebLogic architecture
21 LiveWire
22 LiveWire model
23 Main classes
24 Example
25 Sources of information
26 Summary

Outside Index Summary of Material



HTML version of Basic Foils prepared 23 February 97

Foil 1 Java - Database Connectivity

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
Report about existing solutions
Konrad Olszewski
10th June 1996

HTML version of Basic Foils prepared 23 February 97

Foil 2 Covered products

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
JDBC
Oracle Web Server
WebLogic products
Netscape LiveWire

HTML version of Basic Foils prepared 23 February 97

Foil 3 Motivation

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
Java - interactive Web computing, portable programming language, persistent client-server networking
RDBMS - information management, search backend, data processing
Java + RDBMS - fully integrated client-server application on WWW

HTML version of Basic Foils prepared 23 February 97

Foil 4 Traditional Web/RDBMS Configuration

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
WWW client
HTTP server
traditionally using CGI for HTTP server to
access databases and query results were displayed as HTML pages on Web browsers
the requests and responses were transmitted using HTTP protocol, no session notion and database transaction logic is not perserved.
CGI script
HTTP
protocol

HTML version of Basic Foils prepared 23 February 97

Foil 5 What's new with Java ?

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
WWW client
HTTP server
integrated
DB client
applet
standalone application
server
Java offers the advantages:
  • putting logic into the client side
  • creating session protocols (overcoming the limitations of HTTP )
  • interactively access to database objects
direct access

HTML version of Basic Foils prepared 23 February 97

Foil 6 JDBC - main features

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
Portable Java API for connecting to RDBMS and executing SQL statements
designed after ODBC (but with Java-specific features)
dependent on provided database drivers

HTML version of Basic Foils prepared 23 February 97

Foil 7 JDBC scheme

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
JDBC-ODBC
Driver
JDBC API
JDBC Driver API

HTML version of Basic Foils prepared 23 February 97

Foil 8 Two tier vs. three tier

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
socket
connection
Server application
JDBC access
JDBC access
client side
server side

HTML version of Basic Foils prepared 23 February 97

Foil 9 Driver Manager

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
The Driver Manager tracks database drivers
Drivers have to register themselves
Driver Manager maps URL to drivers
URL jdbc:<subprotocol>:<subname>
Example:
  • jdbc:oracle://naos:2007/stuff
  • jdbc:odbc:stuff

HTML version of Basic Foils prepared 23 February 97

Foil 10 Main classes

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
Driver Manager
Connection
Statement
ResultSet
getConnection
executeQuery
getXXX
createStatement

HTML version of Basic Foils prepared 23 February 97

Foil 11 Metadata

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
ResultSetMetaData - description of the ResultSet
  • column names,
  • types
  • properties
DatabaseMetaData - description of database connection:
  • implementation details
  • database schema

HTML version of Basic Foils prepared 23 February 97

Foil 12 Example of use

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
...
Connection conn = DriverManager.getConnection( "jdbc:odbc:sales");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery( "SELECT Name, Sales FROM Customers");
while (rs.next()) {
String name = rs.getString("Name");
int sales = rs.getInt("Sales");
...

HTML version of Basic Foils prepared 23 February 97

Foil 13 Oracle Web Server

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
tightly integrated with Oracle DBMS
executing Java code on server side
communication with database based on PL/SQL wrappers
designed to work with dynamically created HTML

HTML version of Basic Foils prepared 23 February 97

Foil 14 Example of use

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
Session session = new Session("scott", "tiger", "HR_DB");
//wrapper for PL/SQL package
Employee employee = new Employee(session); PDouble pEmployeeNumber = new PDouble ((double)12345);
System.out.println("Employee ID: " + pEmployeeNumber + " name:" + employee.employee_name(pEmployeeNumber));

HTML version of Basic Foils prepared 23 February 97

Foil 15 Principle of operation

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
Web client
URL
Oracle
Web Server
HTML
WRB is a Web Request Broker

HTML version of Basic Foils prepared 23 February 97

Foil 16 Couldn't it be better?

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
WWW client
URL
OWL
Live HTML
with applet
applet
TCP/IP
or Remote Objects

HTML version of Basic Foils prepared 23 February 97

Foil 17 Comparison of two approaches

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
the first one is just a Java CGI
the second is a full client-server application
  • connection is kept open between transactions
in second case it's necessary to develop own network protocol (or use Remote Objects in the future)

HTML version of Basic Foils prepared 23 February 97

Foil 18 WebLogic

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
Set of proprietary solutions to access DB from Java
works with Oracle, Sybase and Microsoft SQL Server
uses two and three-tier configurations
possibly will be integrated with JDBC

HTML version of Basic Foils prepared 23 February 97

Foil 19 WebLogic libraries

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
data container objects (dataset, record, value, blob)
data description objects (schema, column, table, SelectStmt, StoredProc)
session objects (Profile, Database, Connection)
administration objects

HTML version of Basic Foils prepared 23 February 97

Foil 20 WebLogic architecture

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
WWW client
T3Client
applet
WebLogic supports cached logins - client can disconnect and connect
once again to the same state at application server
HTTP
server
applet
download
proprietary
protocol
proprietary
protocol
T3Server

HTML version of Basic Foils prepared 23 February 97

Foil 21 LiveWire

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
provided by Netscape FastTrack server
using JavaScript to perform database operations on the server side
database connection and SQL queries can be embedded in Javascript code in HTML pages (Javascript can interact with Java applets in future versions of Javascript)
application server is part of HTTP server
currently working with Oracle, Sybase, Informix, ODBC

HTML version of Basic Foils prepared 23 February 97

Foil 22 LiveWire model

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
Database connections and operations are performed on the server
with use of the server-side JavaScript
HTTP
protocol
database
specific
protocol

HTML version of Basic Foils prepared 23 February 97

Foil 23 Main classes

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
Database (connections, executing SQL statements, displaying tables, transaction controls)
Cursor (data access and manipulation)

HTML version of Basic Foils prepared 23 February 97

Foil 24 Example

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
<server>
database.connect("ORACLE", "naos", "name", "pass", "");
cursor=database.cursor("select * from Employee");
while (cursor.next()) {
write(cursor.id);
write(cursor.name);
}
</server>

HTML version of Basic Foils prepared 23 February 97

Foil 25 Sources of information

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
JDBC http://splash.javasoft.com/jdbc/
WebLogic http://www.weblogic.com/
OWS http://www.oracle.com/webserver/
LiveWire http://wasat.npac.syr.edu/Lwdoc/livewire.htm

HTML version of Basic Foils prepared 23 February 97

Foil 26 Summary

From Overview of Approaches to Java - Database Connectivity Rome Lab Quarterly Review for CIV -- June 28 96. *
Full HTML Index
The JDBC will probably establish general-purpose standard in Java/DB connectivity
OWS is a good solution for applications tightly related to Oracle and based on PL/SQL
LiveWire is suitable for easy access to DB from HTML pages

© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Thu Aug 14 1997