Applications Programming Considerations

Note architecture in Figure 8.1:  Client-Server Software.

Example of this is a three-tiered web site (Figure 8.2)

Microsoft Access Interaction:


Embedded SQL

We look at an example of an SQL statement embedded within a C fragment:

void addEmployee(char* ssn, char* lastName, char* firstName)
{
   EXEC SQL
      insert into Customer (ssn, lastName, firstName)

         values (:ssn, :lastName, :firstName);
}
 

JDBC Specifics

Here are some of the interfaces from jva.sql that provide SQL accessibility:

As our example, we look at the "Simple Java SQL Application" of section 8.6 (This is Figure 8.10 on pages 192-3).
We make the following observations relative to this code: For reference of those who might care to make use of it, I have copied a folder, RiccardiSW to the T drive.
We look at the documentation in JBuilder for java.sql, especially those parts addressed in the example of Figure 8.10.  To get this,
 

 
 
 
 

Technologies for Supporting Databases on WWW

We first demonstrate, using amazon.com, and consider the issues from the point of a remote database.

Next we have a look at Figure 9.1, a manifestation of Figure 9.2 and pick out some highlights of HTML.

Crucial in the operation of a remote database is a specification for communicating between browser and server.  The best-known specification is called "Common Gateway Interface" (CGI) A result of hitting the submit button might be:
http://localhost/cgi-bin/
reservation.cgi?accountId=101&streId=3&action="displayForm
CGI code is trasmitted from browser to server in text form.  An example is given at the bottom of page 213

104 x+& </. becomes 104+x%2B%26+%3C%2F.

At the server end,  the CGI data are given to the CGI program -- which may be written in Java.  In our applications, we can expect that the CGI program executes SQL statements against a database, then returns the results to the client.

Riccardi shows in Section 9.3 that the HTML code for a web page can be written in Java.  In Section 9.4 he shows the way CGI programming can be done using Java (the most common language for CGI programming is Perl).

Section 9.5 introduces servlets -- small servers dedicated to specific CGI requests.  A servlet awaits a request.  The strategy is to treat each CGI request as an interaction with a running system.  Thus, the connection between client and server persists.