CS/INFO 530 S05     TR 11:40-12:55     Olin 245

CS/INFO 530: Architecture of Large-Scale Information Systems

 
 

Project 0: Getting Started

This pseudo-project is intended to get you started with the environment on the laptops. Each of you should do this independently to your own laptop. On the other hand, you are encouraged to help one another if you get stuck.

There is a section below for each of the necessary software components.

By the way, the first thing you should do to your laptop is set the password to something other than blank, right?

The Database Management System: Microsoft SQL Server

This installation is straightforward from the CD provided with your laptop. The description, long and full of screen shots, is here.

Java

Next install the Java runtime. The version you want is
J2SE v 1.4.2_07 SDK
available here from Sun Microsystems. Note the installation instructions are a separate download.

The Application Server

JBoss is a J2EE-capable application server bundled with the Apache Tomcat web engine. You can find it at the JBoss downloads page. The current version is 4.0.1. Installation is pretty straightforward. Follow the directions from “Installation” through “Startup” at this page. If you are not familiar with setting environment variables in Windows, one place to find instructions for this is the Sun JDK installation notes referenced above. If your installation is successful, you should be able to start the JBoss server and visit the JBoss server console using Internet Explorer or FireFox.

The Eclipse IDE

Next you need the Eclipse IDE platform. You can find the download at the eclipse.org downloads page (the current release is 3.0.1; click “View all platforms for release 3.0.1” to get the download for Windows XP). This is just a .zip file that you can expand where you want the IDE to live. Mine is
C:\eclipse-SDK-3.0.1-win32
To start the IDE, double-click the Eclipse icon you'll find in the bin subdirectory. It requires the JAVA_HOME environment variable.

The JBoss-IDE Plugin

Finally, you need the plugins to help Eclipse interface with a JBoss running J2EE. Eclipse will download the JBoss-IDE plugins for you automatically, if you follow the instructions here. These instructions work pretty well, with one problem. In the section called “Adding the shortcuts to the Top Menu” where it says to check “Default Server” in the “Available Command Groups” pane, you must make sure that “Launch” is also checked. Otherwise the following step will fail (you will not find a “Debug” item in the “Run” menu). For now, you want to configure the “default” version of the server, rather than “all” or “minimal”.

Use the IDE to start the default JBoss server you have just configured. Visit the JBoss server console with your favorite browser to check that things are working.

JDBC Drivers

To access a database from Java Servlet code, you must install a JDBC driver.

A JDBC driver for SQL Server is available from Microsoft as a free download here. In theory, you can simply download the driver package and run the installer that comes with it. Caveat: I have not tried this personally.

An alternative is to get the JDBC driver .jar files and either incorporate them into your project or install them in the

server/default/lib
subdirectory of the JBoss installation. Three .jar files are required: msbase.jar, mssqlserver.jar, and msutil.jar. An archive comprising only these files is available here

There are a few other things you need to know (or figure out) to create create and use a JDBC connection:

  • the fully qualified driver class name:

    com.microsoft.jdbc.sqlserver.SQLServerDriver

    You need this when you call Class.forName() to get the driver loaded into the Java VM.

  • the database connection URL. This URL is constructed by filling parameter values into a (driver-dependent) pattern; the pattern for the Microsoft SQL Server driver is

    jdbc:microsoft:sqlserver://<HOST>:<PORT>[;DatabaseName=<DB>]

    In the default SQL Server installation the port is 1433. If your database name is “CS530DB0”, the connection URL will be

    jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=CS530DB0

  • the database username and password. You need these to authenticate to the database when you create a new JDBC connection.
These parameters will appear in your Java sources.

A Simple Web Site

To demonstrate that all these components work, build the following simple website.

The site has a number of users, and maintains a collection of <name, value> pairs for each user. This data is stored persistently in a back-end database. Note the data could be stored in a single relation

R( userid, name, value )
where all columns are strings and the pair <userid, name> is the primary key.

When a user enters the site, she fills her name (i.e. userid) into a form.

(You might expect a login password here, but we're trying to keep things simple.)
A (really Spartan) version of the entry page might look like this. The site remembers the userid in a session data object, as discussed in lecture on Tuesday, then repeatedly presents a form that allows the user to query or update any of her stored <name, value> pairs. Before issuing the first query, the form page could look like this. After issuing a query, it might look like this.

This site can be implemented with a few Java servlets using the session API and JDBC. If you are a bit rusty on these things, here are:

A Few Helpful Links:

There are many other tutorials and references available on the Web for anyone who can use Google effectively.

Unfortunately, the hardest part of all this will be learning to get all the deployment descriptor stuff right in an unfamiliar IDE.

What to Submit

Create a .zip archive called proj0.zip containing the following:

  • all your source files (.html, .java or .jsp)
  • screen shots of your form pages and a query result
  • an output of a SELECT * ... query on your database table from the MS Query Analyzer tool.
Submit the zip file to CMS before midnight on the due date.
 

HOME | DESCRIPTION | ANNOUNCE | LECT | HW | PROJ | MAIL