Help is available for each task, or you can go straight to the
source code, which is one particular
solution.
Task 1
Pick a system to use as the datasource.
- Microsoft Access
- Make a directory for the database
- Copy testdb.mdb file to that directory
- Text Files
- Oracle / SQL Server / dbAnywhere / ...
- This option is not available in the standard MageLang lab environments.
- The SQL scripts comments.sql,
instructors.sql,
and students.sql, need to be run against your
database. You can modify the loadme.bat file to
run with your server, or load them directly into an interactive SQL GUI tool,
or run the MageSetup program.
However, you cannot run any of them until you complete Step 2.
- mSQL is not recommended for exercises because the current implementation does
not permit access to database metadata or use of prepared statements.
Follow steps for your specific datasource/platform.
- Microsoft Access
- mkdir \magedb
- Shift-Click on the link for the testdb.mdb
file and save it to the \magedb directory.
- Make sure the file is saved with the appropriate file extension.
- Text Files
- mkdir \magedb
- Shift-Click on the link for the comments,
instructors, students,
and schema.ini files and save them to
the \magedb directory.
- Make sure files are saved with their appropriate file extensions.
Task 2
From Windows 95/NT 4.0:
- Bring up Control Panel
- Select the Start button
- Select the Settings menu item
- Select the Control Panel menu item
- Find and double-click on the ODBC Icon (32-bit/with 32 on it).
This brings up the 'Data Sources' window.
- Select Add. This brings up the Add Data Source window.
- Select the driver for the type of driver you want.
If you selected Text, the ODBC Text Setup window appears.
- Name the data source mage.
- Fill in a description.
- Select the directory in which you placed files from the initial task.
- Select OK to accept new driver.
If you selected Microsoft Access, the ODBC Microsoft Access 7.0 Setup window appears.
- Name the data source mage.
- Fill in a description.
- Click on the Select button to bring up a file dialog.
- Locate the directory created in task 1.
- Select OK to accept new driver.
From Solaris 2.x:
- For Intersolv ODBC Bridge
- Edit the odbc.ini file in the Intersolv installation directory,
possibly /opt/Intersolv, to define a data source mage.
If your database server happens to be Oracle 7, you can use an entry
similar to this.
- Update the database server to map the ODBC name to a database entry.
If your database server happens to be Oracle 7, you can add an entry
similar to this to Oracle's
tnsnames.ora file. The sample file maps mage to the
Oracle sid examplesid.
- Configure your CLASSPATH to point to the JDBC classes, the InterSolv
classes, and to find the ODBC driver. A sample bourne shell script is
provided.
Images to help you along the way for Microsoft Windows.
For more information on Oracle TNS and SQL*Net, refer to Oracle administrators
reference manuals.
|