Database Reference
In-Depth Information
Database
Server
Method 1
Pure Java
JDBC driver
Method 2
JDBC
Driver
Manager
DBMS
Middle-
ware
Java
Applica-
tion
Pure Java
JDBC driver
JDBC
API
Method 3
JDBC-
ODBC
Bridge
Pure Java
JDBC driver
ODBC
Figure 19-9
JDBC approaches.
approach. Because ODBC has become the de facto standard for database access,
this is a popular method.
Figure 19-9 illustrates these three approaches of using JDBC. In each case, note
the layers through which interface between a Java application program and a data-
base system is established.
Use of Scripting Languages
This is another method for providing database functionality to browsers and servers.
JavaScript from Netscape and JScript from Microsoft are the commonly used script-
ing languages. JavaScript resembles Java in its structure. Another popular scripting
language is VBScript from Microsoft. The syntax of VBScript is more like that of
Visual Basic than Java.
A script written in any of these languages may be embedded in the HTML and
downloaded every time the page is accessed. The scripting languages are inter-
preted, not compiled. Therefore, they are well suited for small applications.
Scripts executing on the browser have objectives similar to applets written in the
Java language. Figure 19-10 presents a comparison between client-side JavaScript
and Java applets.
JavaScript on the Server Side On the server side, JavaScript can perform the
functions related to database operations, as listed below:
Establish connection to a database.
Begin database query or transaction.
Retrieve data requested in the query or perform database operations included
in the transaction such as inserts, updates, or deletes.
Search WWH ::




Custom Search