Data Access Technologies

Post on 17-Jun-2015

381 views 2 download

Tags:

transcript

Choosing Data Access Technologies

and an Object Model

Instructor : Dimara Kusuma Hakim, ST.

Data Access System Components

Middleware Data Access Component

SQL Server

DB2

Oracle

Middleware Data Access Component

SQL Server

Oracle

DB2

Middleware Data Access Component

Client-side Components

Server-side Components

Data AccessTechnologies

Desktop Computer Database Server

Data access libraries that support client-side

OLE DBOLE DB ODBCODBC

ADOADO ADO.NETADO.NET

Data Access Technologies

VBSQL.OCXVBSQL.OCXVBSQL.OCXVBSQL.OCX

Database ApplicationDatabase Application

ADOADOADOADO

OLEDBOLEDBOLEDBOLEDB

DB-LibraryDB-LibraryDB-LibraryDB-Library

SQLNCLISQLNCLISQLNCLISQLNCLI

Client Network LibraryClient Network LibraryClient Network LibraryClient Network Library

.NET .NET Framework Framework

Data ProviderData Providerfor SQLfor SQLServerServer

.NET .NET Framework Framework

Data ProviderData Providerfor SQLfor SQLServerServer

Storage Storage EngineEngine

Storage Storage EngineEngine

Relational Relational EngineEngine

Relational Relational EngineEngine

TSQL EndpointTSQL EndpointTSQL EndpointTSQL Endpoint

Server Network LibraryServer Network LibraryServer Network LibraryServer Network Library

DB ServerDB Server

Architecture of Data Access Technologies

Considerations for Using Earlier Technologies to Access Data

Legacy technology Considerations

DBLibrary

ODBC Generic, industry-standard; still the only option for some data sources

OLE DB Available for relational and non-relational data sources

SQLXMLFunctionality to be replaced by HTTP endpoints and new XML support in SQL Server 2005

Guidelines for Accessing Data When Using Databinding

Consider the following guidelines for accessing data by using Databinding :Consider the following guidelines for accessing data by using Databinding :

Implement concurrency violation detection codeImplement concurrency violation detection code

Use connection poolingUse connection pooling

Filter data properlyFilter data properly

Acquire late, release earlyAcquire late, release early

Explicitly close connectionsExplicitly close connections

Connection

SqlConnection cn = new SqlConnection(“Data Source=MIA-SQL\SQLINST1;InitialCatalog=AdventureWorks;Integrated

Security=True”);cn.Open();

SqlConnection cn = new SqlConnection(“Data Source=MIA-SQL\SQLINST1;InitialCatalog=AdventureWorks;Integrated

Security=True”);cn.Open();

ServerServerClientClient

Execution Session Execution Environment

Session IDSession ID

Connection Pool

SqlCommand cmd1 = new SqlCommand(“SELECT ...”, cn);SqlCommand cmd2 = new SqlCommand(“UPDATE ...”, cn);

SqlDataReader rdr1 = cmd1.ExecuteReader();SqlDataReader rdr2 = cmd2.ExecuteReader();

SqlCommand cmd1 = new SqlCommand(“SELECT ...”, cn);SqlCommand cmd2 = new SqlCommand(“UPDATE ...”, cn);

SqlDataReader rdr1 = cmd1.ExecuteReader();SqlDataReader rdr2 = cmd2.ExecuteReader();

cn.Close();cn.Close();

ServerServerClientClient

Demonstration: Connecting SQL Server to Other Data Stores

In this demonstration, your instructor will explain the various ways to connect SQL Server to other data stores

In this demonstration, your instructor will explain the various ways to connect SQL Server to other data stores