General notes

Make sure to download the CSE 444 shell launcher script.
Note that you may need to modify the hard-coded paths in the script
to use it on a non-Lab machine.

You must be running as an Administrator to perform many of the tasks described here. In Vista you may need to
choose the "Run as Administrator" option (right-click the program or shortcut, "Run as Adminstrator").

Installing Java

Installing PostgreSQL and its JDBC driver

Install it with the default options. The installer should prompt you to create two different passwords,
but you only need to fill in the one for the "database superuser"; the installer will auto-generate a value
for the other password (the "service password") if you don't supply one.
Remember the password you entered; you'll need it later.

Now you need to install the JDBC driver.

Start by running the Stack Builder program, either
by accepting the default options for tasks after install, or
from Start->Programs->PostgreSQL 8.4->Application Stack Builder.

Verify that the files C:\Program Files\PostgreSQL\8.4\bin\psql.exe and
C:\Program Files\psqlJDBC\postgresql-8.4-701.jdbc4.jar exist.

Installing the JDBC driver for SQL Server

Follow these steps:

Download the JDBC driver from Microsoft.
You'll end up "downloading" the license agreement; scroll to the bottom, then choose Accept to download the actual file.
(The two "Accept" links point to different archives storing the same data;
the "Windows version" is a self-extracting EXE, while the "UNIX version" is a gzipped tarball (.tar.gz file).)

Verify that the file C:\Program Files\Microsoft SQL Server 2008 JDBC Driver\sqljdbc4.jar exists. If it does not you may need to copy it to that directory from C:\Program Files\Microsoft SQL Server 2008 JDBC Driver\sqljdbc_2.0\enu\sqljdbc4.jar

Adapting the PostgreSQL instructions

The first exception is that you can completely skip the sections titled
"Creating a data folder" and "Starting and stopping PostgreSQL".
The installer already created a data folder, so you don't need to create one yourself,
and it set up PostgreSQL to start and shut down along with the computer, so you don't need
to start it explicitly.

The second exception is the way you log in to the database system.
On Lab machines (when following the suggested procedure for creating a data folder),
you are not normally asked for a username or password when connecting to the database.
This is because your PostgreSQL username is the same as your Windows username
(the default username for PostgreSQL client tools and libraries), and PostgreSQL
automatically trusts all connections from the local computer, so any local user
can connect using any PostgreSQL username without providing a password.

By default, however, PostgreSQL installed using the Windows installer will prompt you for a
username and password; you will need to use postgres for the username and the
"database superuser password" you previously set for the password. There are two ways to work
around this problem:

Shut down the PostgreSQL service (net stop pgsql-8.4), then
run it manually using a data folder created with initdb, as you would do on a Lab
computer.

Modify the data folder created during the PostgreSQL installation
to get the same authentication behavior as one created with plain initdb.
This is a two-step process:

Allow locally connected users to connect without a password:

Open the pg_hba.conf file in the data folder, typically
located at C:\Program Files\PostgreSQL\8.4\data\pg_hba.conf.

Modify the last lines of this file, which read:

# IPv4 local connections:
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 md5

by changing "md5" to "trust", so they read:

# IPv4 local connections:
host all all 127.0.0.1/32 trust
# IPv6 local connections:
host all all ::1/128 trust

Save and close the file. (If this fails, you may need to re-open the file as an
Administrator, and try again.)

This command creates a PostgreSQL user with administrative privileges (-s),
and the same name as your Windows username (value of the environment variable
USERNAME), using the authority of the existing database superuser (-U
postgres).