The Web and data management - Wiley

indexadjustmentInternet και Εφαρμογές Web

13 Νοε 2013 (πριν από 3 χρόνια και 10 μήνες)

80 εμφανίσεις

The Web and Data
Management

Experience is never limited, and it is never complete;
it is an immense sensibility, a kind of huge spider
-
web of the finest silken threads suspended in the
chamber of consciousness, and catching every air
-
borne particle in its tissue.


Henry James

New data management role

Managing Web site data

Linking databases to the Web

Multimedia databases

Information presentation

Information architecture

The macro organization of information

Information design

The arrangement of information structures

Information arts

The arrangement of information elements
on a page

Organization models

Type

Examples

Linear

A novel

Hierarchical

An organizational chart

Web

Thesaurus

Parallel

Airline timetable

Matrix

Calendar

Overlay

X
-
ray

Spatial zoom

Magnification of a thumbnail image

Navigation aids

Signs let visitors know where they

are

can go

Good examples are the London

Underground and Paris Métro

The design process

Architecture

Outline the broad structure

Use an outliner

Design

Clarify the form of each section

Show linkages between pages

Information arts

Add the information elements to each page

The design process

Consistency

A consistent look and feel accelerates
information finding

A performance

Web sites are expected to be entertaining
as well as informative

The Web site defines the firm for many
stakeholders


The shop window or building facade

Web site management

Creating and maintaining HTML

Use a special
-
purpose editor

Managing a Web site

Use a special
-
purpose tool such as Adobe
GoLive

Site management

Site management

Visual site management

Automatic link changes

Link checker

Internal

External

Web site publishing

Some guidelines

All images in one file

Consistent naming

Lowercase

Resource Description
Framework

We need a more precise description of
what is on the Web

Move the Web from machine
-
readable
to machine
-
understandable.

The RDF is a general framework for
describing any Internet resource

Sample RDF

<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22
-
rdf
-
syntax
-
ns#"


xmlns:dc="http://purl.org/dc/elements/1.0/">



<rdf:Description
rdf:about="http://www.wiley.com/college/watson"


dc:creator="Richard T. Watson"


dc:title="Data Management"


dc:description="Support for the 4th edition
of Data Management: Databases and Organizations
by Richard T. Watson"


dc:date="2003
-
07
-
01" />

</rdf:RDF>

DBMS connectivity

The Web browser is the interface of
choice

One
-
time installation

Global

Simple design is easy to learn

A standard interface makes new
applications easier to learn

Three
-
tier architecture

Web

browser

Web

browser

Web

server

DBMS

server

DBMS

server

DBMS

server

Options

Common gateway interface (CGI)

Does not scale well

Proprietary Web server APIs

Ties to vendor’s software

ASP (active server pages)

SSJS (server side JavaScript)

Java servlets and JSP

Java is difficult to learn

PHP

An open source server side scripting language

A PHP application consists of HTML and
PHP script, which are executed by the server
before sending a page of HTML code to the
browser

Works with any browser

Platform independent

Versions are available for most operating
systems and Web servers

PHP

Less network traffic because the
browser has to send fewer commands to
the server

Simple interface to a DBMS

Code cannot be seen by the browser
user and thus security is high

Simple PHP script

simple.php

1.
<html>

2.

<?php

3.


echo "PHP displays this message.";

4.

?>

5.
</html>

Connecting to a database

connect.php

1.
<html>

2.

<?php

3.

// Connection data

4.

$db_name = "sample";

5.

$db_username = "rwatson";

6.

$db_passwd = "secret";

7.

$connect = odbc_pconnect($db_name,$db_username,$db_passwd);

8.

?>

9.
</html>

Executing SQL

execsql.php

1.
<html>

2.

<?php

3.

// Connection data

4.

$db_name = "sample";

5.

$db_username = "rwatson";

6.

$db_passwd = "secret";

7.

$connect = odbc_pconnect($db_name,$db_username,$db_passwd);

8.

$sql = "select * from shr";

9.

echo $sql;

10.

$result=odbc_exec($connect,$sql);

11.

odbc_result_all($result);

12.

?>

13.
</html>

SQL command entry form

sqlcmd.html

1.
<html>

2.

<title>SQL interface</title>

3.

<body bgcolor="white">

4.

<form method="post" action="execsqlcmd.php">

5.

Enter SQL query<br>

6.


<textarea name="sqlcmd" rows="5”


cols="60"></textarea><br>

1.

<input type="Submit">

2.

</form>

3.

</body>

4.
</html>

SQL command entry form

SQL execution

execsqlcmd.php

1.
<html>

2.

<body bgcolor="white">

3.

<?php

4.

// Connection data

5.

$db_name = "sample";

6.

$db_username = "rwatson";

7.

$db_passwd = "secret";

8.

$connect = odbc_pconnect($db_name,$db_username,$db_passwd);

9.

$query=stripslashes($sqlcmd);

10.

echo "Query: " . htmlspecialchars($query) . "<br>
\
n";

11.

$result=odbc_exec($connect,$query);

12.

odbc_result_all($result);

13.

?>

14.

<form action="sqlcmd.html">

15.


<input type="submit" value="New query">

16.

</form>

17.

</body>

18.
</html>

Error detection

execsqlerr.php

1.
<html>

2.

<?php

3.

// Connection data

4.

$db_name = "sample";

5.

$db_username = "rwatson";

6.

$db_passwd = "secret";

7.

$connect = odbc_pconnect($db_name,$db_username,$db_passwd);

8.

$sql = "select * from shr";

9.

echo $sql;

10.

$result=odbc_exec($connect,$sql);

11.

if($result == 0) echo "SQL command error";

12.

odbc_result_all($result);

13.

?>

14.
</html>

Development with Java

Java is a platform
-
independent
development language

Java options

Application

Java virtual machine

Application

Adapter

Java virtual machine

Browser

Adapter

Application

OS

OS

Java OS

Hardware

Hardware

Java chip

Java on browser

Java on OS

Java on chip

JDBC

Java database connection

Enables development of applications
that are OS and DBMS independent

Application

JDBC API

JDBC driver manager

Service provider API

Driver for DBMS server

DBMS server

Processing a SQL query

Conclusion

The Web is giving many applications a
new face

It is relatively easy to create a Web
interface to a database

There are many choices

Open standards are preferable for long
-
term investments

e.g., PHP or Java