Professional Documents
Culture Documents
By David Drake 12 noon, October 31, 2001 ITC-Research Computing Support Center 244 Wilson Hall, 243-8800, res-consult@virginia.edu
I. A. Definition
A database is an organized collection of data whose content must be quickly and easily
Accessed Managed Updated
A relational database is one whose data are split up into tables, sometimes called relations
I. B. Normalization
(read logical organization)
First Normal Form (1NF)
All attributes are single valued & non-repeating
I. C. 1. Tables (Relations)
Each column constitutes an attribute Each row constitutes a record or tuple
Attribute 1 (column 1) Record 1 (tuple 1) Record 2 (tuple 2) Attribute 2 (column 2)
I. C. 2. Keys
Primary
An attribute or group of attributes which uniquely identifies each record in a table May not be a Null value
Foreign
used primarily for enforcing referential integrity, but also for establishing relationships between the two tables
I. C. 3. Relationships
One-to-one (1-to-1) One-to-many (1-to-M or 1-to-g) Many-to-Many (M-to-M or g-to-g)
B. MySQL (Documentation)
C. Others
MySQL
MySQL server (dbm1.itc.virginia.edu) Home directory (www.people accessible through blue.unix), faculty, curry, avery, minerva www, jm.acs www.itc(.virginia.edu)
Open connection:
conn.open("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=f:\web\database\rescomp\study.mdb")
Record Sets:
RS.Close set RS = nothing
The Connection:
conn.close set conn = nothing
ASP Security
Apart from various Internet Information Services (IIS Windows Web service) security holes (for viruses and worms), security is quite good. Use https:// if you want to protect content over the internet provides Secure Socket Layer (SSL) security
ASP Resources
ITC-Training Workshops
ASP Introduction
Microsofts VBScript Tutorial & Language Reference (also here) ITC-Desktops examples WebMonkeys tutorial
ColdFusion
Easy-to-learn Server-Side Scripting Language: CFML, or Cold Fusion Markup Language, is embedded in HTML code CF code is enclosed in or by CF tags:
<CFtagname CF code > <Cftagname > CF Code </Cftagname >
Documents must end in .cfm ColdFusion is Case Insensitive Example (code, copy of database)
All variables in the form object (e.g. Form.var1) that match attributes in the table are inserted into the table automatically
Ubiquitous
Originally designed to be a better general purpose tool than a Unix shell, it has grown and spread to be supported from Windows to Macintosh to VMS.
First printed line must be the following if you want its response to go to a browser:
print "Content-type: text/html\n\n";
Clean up
$sth->finish; $dbh->disconnect;
Perl Security
Perl/MySQL can be made secure apart from one serious flaw as implemented at UVa:
Because web files must be readable by the world (unix permissions), anyone with an account on the server where you run the php code can see the code, including your MySQL $password! A couple of exceptions to this flaw are as follows:
If you secure your server so that there are no other users on it (It may** be possible to compile Perl scripts into binary executables using perlcc. Then you must hide or remove your source code containing the MySQL password) One other possible poor to fair workaround: use .htaccess to password protect your php directory (limited access)
Perl Resources
ITC-Training Workshops
Perl Programming Introduction Perl Programming for the Web
Perl Documentation
Overview, Built-in functions, Data types, Regular expressions, Modules: DBI(1), DBI(2), CGI
WebMonkeys Tutorial, etc. MySQL and PERL for the Web by DuBois (New Riders) Learning Perl by Schwartz & Christiansen (OReilly) Programming Perl by Wall, Orwant, & Christiansen (OReilly) Programming the Perl DBI: Database Programming with Perl by Descartes, Bunce, & Mui (Editor) (OReilly)
Example (code)
PHP/MySQL Security
The same problems as PHP occur with Perl if you run it as a Perl or CGI script.
See the passwords link
PHP Resources
ITC-Training Workshops
PHP and MySQL
PHP Documentation ITC-Desktops examples PHPs Tutorial WebMonkeys Tutorial PHP and MySQL Web Development by Welling & Thomson (SAMS) Beginning PHP4 by Blan, Choi, et. al (Wrox)
(Other) Books
MySQL by DuBois (New Riders) MySQL and PERL for the Web by DuBois (New Riders) MySQL & mSQL byYarger, Reese, & King PHP and MySQL Web Development by Welling & Thomson (SAMS) Beginning PHP4 by Blan, Choi, et. al (Wrox) Learning Perl by Schwartz & Christiansen (OReilly) Programming Perl by Wall, Orwant, & Christiansen (OReilly) Programming the Perl DBI: Database Programming with Perl by Descartes, Bunce, & Mui (Editor) (OReilly) SQL-99 Complete, Really by Gulutzan & Pelzer (R&D Books)
Java
Write once for all platforms Makes use of local Java Virtual Machine (JVM)