23
IS 4506 Database Connectivity

IS 4506 Database Connectivity

  • Upload
    maine

  • View
    36

  • Download
    0

Embed Size (px)

DESCRIPTION

IS 4506 Database Connectivity. Overview. Two and Three-Tier C/S Architecture ASP Database Connection ODBC - Connection to DBMS Overview of transaction processing. Client /Server Architecture. PCs. Database Server. Middleware. Web Client/Server Architecture. Client Web Browser. - PowerPoint PPT Presentation

Citation preview

Page 1: IS 4506 Database Connectivity

IS 4506

Database Connectivity

Page 2: IS 4506 Database Connectivity

Overview

Two and Three-Tier C/S Architecture

ASP Database Connection

ODBC - Connection to DBMS

Overview of transaction processing

Page 3: IS 4506 Database Connectivity

Client /Server Architecture

Database Server

PCs

Middleware

Page 4: IS 4506 Database Connectivity

Web Client/Server Architecture

Client Web Browser

HTTP Server

INTERNET INTRANET

Page 5: IS 4506 Database Connectivity

Multi-Tier Client/Server Architecture

DatabaseServer

Client Web Browser

HTTP Server

INTERNET INTRANET

Page 6: IS 4506 Database Connectivity
Page 7: IS 4506 Database Connectivity
Page 8: IS 4506 Database Connectivity
Page 9: IS 4506 Database Connectivity
Page 10: IS 4506 Database Connectivity
Page 11: IS 4506 Database Connectivity
Page 12: IS 4506 Database Connectivity

ODBC Errors

a) A user tries to connect to a database via your company’s web site and receives the error "ODBC…" Login failure. What is the possible cause?The user has insufficient permission to access the database.

b) A user tries to connect to a database via your company’s web site and receives the error "ODBC…" General network error. What is the possible cause?Due to heavy use, the database was recently moved to another server.

Page 13: IS 4506 Database Connectivity

ODBC Errorsc) A user tries to connect to a database via your company’s web site and receives the error "ODBC…" MS OLE ODBC provider for ODBC driver error 80004005. MS ODBC driver manager. Data source name not found and no default driver specified. What is the possible cause? Data source name is configured incorrectly.

d) A user tries to connect to a database via your company’s web site and receives the error "ODBC…" Unable to find resources. What is the possible cause? ODBC driver not configured.

Page 14: IS 4506 Database Connectivity

ASP Code<%@ LANGUAGE = "VBSCRIPT"%>

<%

Set OBJdbConnection = Server.CreateObject("ADODB.Connection")

OBJdbConnection.Open "is4506","", "”

strSQL = "INSERT INTO Students (FName,LName,Email) VALUES

('" & Request.Form("first") & "', '" & Request.Form("last") & "','" & Request.Form("email") & "')"

OBJdbConnection.Execute(strSQL)

OBJdbConnection.Close

%>

Page 15: IS 4506 Database Connectivity

Database Connection - Input

Set OBJdbConnection = Server.CreateObject("ADODB.Connection")

OBJdbConnection.Open "is4506","", ""

strSQL = "INSERT INTO Students(fname,lname) VALUES ('" & Request.Form("fname") & "', '" & Request.Form("lname") & "')"

OBJdbConnection.Execute(strSQL)

OBJdbConnection.Close

Page 16: IS 4506 Database Connectivity

Database Connection - Update

Set OBJdbConnection = Server.CreateObject("ADODB.Connection")

OBJdbConnection.Open "is4506","", ""

ifname = Request.Form("fname")

'example of using a variable in the SQL expression

strSQL = "UPDATE Students SET fname = ('" & ifname & "'), lname = ('" & Request.Form("lname") & "') WHERE ID = (" & Request.Form("ID") & ")"

OBJdbConnection.Execute(strSQL)

OBJdbConnection.Close

Page 17: IS 4506 Database Connectivity

Database Connection - Delete

Set OBJdbConnection = Server.CreateObject("ADODB.Connection")

OBJdbConnection.Open "is4506","", ""

'Note that the single apostrophe is missing from the ID expression when using numbers vice strings.

strSQL = "DELETE FROM Students WHERE ID = (" & Request.Form("ID") & ")"

OBJdbConnection.Execute(strSQL)

OBJdbConnection.Close

Page 18: IS 4506 Database Connectivity

Overview of Transaction Processing

Transaction

A unit of work that succeeds or fails as a whole

Method for coordinating a series of changes made to a resource or sets of resources

ACID Properties

Atomicity

Consistency

Isolation

Durability

Page 19: IS 4506 Database Connectivity

ACID Properties

Atomicity - Either all changes happen or none happen.

Consistency - Actions taken as a group do not violate any integrity.

Isolation - For actions that execute concurrently, one is either executed before or after the other, but not both.

Durability - Changes survive failures of process, network, operating system, and others.

Page 20: IS 4506 Database Connectivity

Three-Tier Architecture

Presentation

Business/Data components

Data access

Page 21: IS 4506 Database Connectivity

Components of a Transaction

Network

Receiver

Queue

Connections

Security

Thread Pool

Service Logic

Synchronization

Shared Data

Context

DB

Man

ager

Configuration

ClientClient

Page 22: IS 4506 Database Connectivity

The Bank Example

FourComponents

Account Modifies an account

Move Money Debit, credit, or transfer

Receipt Get unique #

Update receipt Allocation 100 receipt #s

ClientClient

Transaction Transaction

Move MoneyMove Money

Account AccountUpdateReceipt

ReceiptReceipt

Page 23: IS 4506 Database Connectivity

MSDE

MSDE is a stripped down version of SQL Server that is included with Access 2000 and Access 2002.

The Access 2000 version is named Microsoft Data Engine. It is a stripped down version of SQL Server 7. It can be installed directly from the Office 2000 CD from the following location: SQL\x86\SETUP\SETUPSQL.EXE

The Access 2002 version is named Microsoft Desktop Engine. It is a stripped down version of SQL Server 2000. It can also be installed directly from the CD from the following location: MSDE\SETUP.EXE

Both servers are fully functional SQL Servers but they do not include a user interface like Enterprise Manager.