News    
Overview    
Details    
Grading    
Homework    
Project    
Schedule    
Download    
Resources    
PSU Policy    
|
|
Spring 2004 / Sections 3 & 4
Resources
Last generated: Thu Apr 15 22:20:22 2004 EST.
DB2
- Trigger example script in DB2 notation.
- Download the following two SQL scripts into your UNIX account:
company_schema.sql (script to create example schema) and company_data.sql (script to populate example data). Open two files using PICO, and change the first line's "dul13" to your PSU ID. Then, run the following:
- Unix prompt% db2 -tf company_schema.sql
- Unix prompt% db2 -tf company_data.sql
If you already have any of the following tables in DB2 -- employee, dept,
item, parts, supply, sale, debit, city, store, supplier -- then, you
will get an error. In that case, drop the table first (eg, DROP TABLE
foo), and re-run. At the end, make sure you have all the necessary
schema/data successfully created in DB2 by running: - db2 => list
tables
- .cshrc: Download this and store it in your CAC home directory.
- When you send a DB2-related question to ITS at PSU, use dbadmin@aset.psu.edu with a copy to TA or instructor.
- How to use SSH client to connect DB2 at CAC Unix machines
- How to create tables and add values in DB2
- How to run SQL commands stored in a file in DB2
- Full DB2 Documentation
- DB2 SQL Commands HELP
PHP
- You can access your PHP file at: http://phpdb.aset.psu.edu/phpdul13/test.php, where replace "dul13" by your PSU ID, of course.
- PHP basic presentation
- test.php: PHP test
- form.php: HTML FORM example
- db-simple.php: PHP example for simple database access
- db.php: PHP example for database access using FORM inputs and error handling (DSN=dul13, ID=dul13, Password=mypassword), where change dul13 to your PSU ID
- db2.php: PHP example for database access using FORM inputs and display results by iteration
UNIX
PSU
|