| Home | Course Objectives | Content Outline | Evaluation Criteria |
| Assignment 1 | Assignment 2 | Assignment 3 | Assignment 4 |
|
|
Here are examples analyzed and developed in class. They are provided to facilitate and complement class lectures. Examples will be added or modified from time to time.
Book.java: A class used to create unique book objects, used in sessions 1 thru 4. Contains all constructors and methods for Book.
BookApp.java: A class used to create unique book objects, used in sessions 1 thru 4. Instantiates Book.
Batch Java: An example MSDOS BAT file used to start java programs outside of the developers tool. Can be scheduled by the Windows scheduler to start and stop applications in the client-server environment.
Multi-threading Multi-threading in Java may seem difficult. The following examples help take the mystery out of Java multi-threading and are explored extensively in class: ATM.java and BankAccount.java:
A GUI Template: Here are two example classes, taken from Murach chapter 11 and modified to include additional input and output. The examples show how the presentation and business rules can be seperated in a JAVA gui application. The gui is contained in LoanCalculatorFrame.java, and the business rules are in FinancialCalculations.java. The examples will be used in class to demonstrate GUI and business rule coding.
Java File Input and Output: The following examples show one way to read and write files using JAVA. The main class AccountIODemo.java, contains the input/output code and instantiates the Account class to perform the processing rules. The examples will explored and modified in class to demonstrate JAVA file processing.
Appending to a File: Here is a handy Log object that appends transactions to a log file. Log.java. The example was developed in class using Murach page 553, student, and instructor input. Client Server: Here are three classes that demonstrate a multi-threaded client server application. TCPClient, is the client, EchoServer, is the server, and Connection is used by the server to create multiple threads. The examples were discussed and analyzed in class.JAVA Database Connectivity: Here is an example ConnectDB.java created using Murach chapter 19. First the database from chapter 19 was registered as an ODBC datasource named cis135. The code shows how to connect to the database with a type 1 driver, create a query string, and produce and manipulate a result set.
Servlets: Here is an excellent example html form and Java servlet to get started with servlet programming. The architecture required to support the servlet will also be explored. Apache 1.3.27, Apache JServe 1.1.1, installed and configured to support the example servlets. The following line of code was also added to the conf file in Apache 1.3.27:
# Include the configuration for Apache JServ 1.1.1
Include "C:\Program Files\Apache JServ 1.1.1\conf\jserv.conf"
Here is a mortgage calculation servlet that reuses the
FinancialCalculations class, from the previous example, and replaces the java gui
with an html form. The servlet was compiled with JAVA version J2sdk1.4.1_01. By using html and an http server, the interface becomes easier
to maintain and the application becomes web-enabled!
* Java Source Code *
* Html Interface *
Click here to download Apache, ApacheJServ, and the jsdk2.0 (jsdk.jar)