DOC PREVIEW
UW CSE 444 - Lecture Notes

This preview shows page 1-2-3-4-5 out of 14 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 14 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

OverviewSystems PollSQL Server: Query AnalyzerSQL Server: LoginSQL Query Analyzer InterfaceCubistCubist (Continue)CGI ProgrammingStatic HTML“Dynamic” HTML w/ PERLDynamic HTML w/ DBDB connection from perlDB Connection from Java1st Project MilestonesOverview•Class systems poll•Microsoft SQL Server•Cubist Server•CGI Programming•JDBC Programming•Project Milestones ReminderSystems Poll•Java or C/C++ ?•Perl•HTML•dynamic HTML: cgi, php, asp, jsp•database systems? Mysql, postgresql, MSSQL, …SQL Server: Query AnalyzerSQL Server: LoginSQL Query Analyzer InterfaceCubist•CGI programs are not allowed by cs web server•Special server: CUBIST•Your account will have directory www•Accessed as –http://cubist.cs.washington.edu/~username/Cubist (Continue)•You will need to access PostgreSQL on Cubist•Account has been setup for you.•Password should have been emailed to you individually.•Getting start with PostgreSQL details are on our course website.CGI Programming•CGI: common gateway interface•a program executed by web server, returning web contentStatic HTML<html><h1> I love databases! </h1></html>www.cs.washington.edu/static.htmlWWWBROWSERGET static.htmlWEBSERVER“Dynamic” HTML w/ PERL#!/usr/bin/perlprint “Content-type: text/html \n”;print “<html>\n”;print “<h1> I love databases! </h1> \n”;print “</html>\n”;www.cs.washington.edu/dynamic.plWWWBROWSERGET dynamic.plWEBSERVERprogram outputCGI ProgramDynamic HTML w/ DBWWWBROWSERGET db_access.plWEBSERVERprogram outputSQL queryquery resultsSQLServerDB connection from perl#!/usr/bin/perl5 -w use CGI;use DBI; $html = new CGI; print $html->header, "\n", $html->start_html(); &searchDatabase;print $html->end_html; sub searchDatabase { $sql = "SELECT * FROM MovieDatabase"; $db = DBI->connect ("dbi:Pg:dbname=database", "cse444", “cse444"); $db or die "Sorry we couldn't connect!\n"; $data = $db->prepare($sql); $data->execute(); $tuple = ""; while ($tuple = $data-> fetchrow_hashref()) { $title = $tuple->{Title}; print “Title is $title<p>";}}DB Connection from Java• Get postgresql.jar from http://jdbc.postgresql.org/import java.io.*;import java.util.*;import java.sql.*;public class Database {public static void main () {try {Class.forName("org.postgresql.Driver");java.sql.Connection con = DriverManager.getConnection (“jdbc:postgresql:database”, “cse444”, “cse444”);java.sql.Statement stmt = con.createStatement();java.sql.ResultSet rs = stmt.executeQuery (“SELECT * FROM MovieDatabase”);while(rs.next()) {System.out.println(“Title is ” + rs.getString(“Title”);}}catch (SQLException e) { System.out.println (“Error in database connection”); }}}1st Project Milestones•Today: Groups formed, email both Alon (alon@cs) and Luna (lunadong@cs) with: –The members of the groups –The group name –The URL of the group web page •Other project milestones details are


View Full Document

UW CSE 444 - Lecture Notes

Documents in this Course
XML

XML

48 pages

SQL

SQL

25 pages

SQL

SQL

42 pages

Recovery

Recovery

30 pages

SQL

SQL

36 pages

Indexes

Indexes

35 pages

Security

Security

36 pages

Wrap-up

Wrap-up

6 pages

SQL

SQL

37 pages

More SQL

More SQL

48 pages

SQL

SQL

35 pages

XML

XML

46 pages

Triggers

Triggers

26 pages

Load more
Download Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?