Database Objects 1/12/2019 See scm-intranet.

Slides:



Advertisements
Similar presentations
Basics of Database Programming with VB6
Advertisements

Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Chapter 10 ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a programming interface to access data in a database.
Introduction to Database Processing with ADO.NET.
1 Pertemuan 09 Database Matakuliah: D0524 / Algoritma dan Pemrograman Komputer Tahun: 2005 Versi:
ASP.NET Programming with C# and SQL Server First Edition Chapter 8 Manipulating SQL Server Databases with ASP.NET.
Chapter 12 Database Connectivity with ASP.NET JavaScript, Third Edition.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Objective In this session we will discuss about : What is ADO. NET ?
ODBC Open DataBase Connectivity a standard database access method developed by Microsoft to access data from any application regardless of which database.
CHAPTER 9 DATABASE MANAGEMENT © Prepared By: Razif Razali.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Using Visual Basic 6.0 to Create Web-Based Database Applications
ADO.NET A2 Teacher Up skilling LECTURE 3. What’s to come today? ADO.NET What is ADO.NET? ADO.NET Objects SqlConnection SqlCommand SqlDataReader DataSet.
Intro to C#.net and EF Ilan Shimshoni. The Three Faces of ADO.NET The connected layer – Directly connecting to the DB The disconnected layer – Using datasets.
Overview of Data Access MacDonald Ch. 15 MIS 324 Professor Sandvig.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
A Simple Introduction. What is ADO.net? First the word ADO stands for ActiveX Data Objects And it is an integral part of.Net Framework of Microsoft hence.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Needs for Accessing Database To make your web site more dynamic and maintainable, you can display information on your web pages that are retrieved from.
Databases and Data Access  Introduction to ADO.NET  ADO.NET objects  ADP.NET namespaces  Differences between ADO and ADO.NET.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Tutorial 30 – Bookstore Application: Client Tier Examining.
1 Introduction to ADO.NET Microsoft ADO.NET 2.0 Step by Step Rebecca M Riordan Microsoft Press, 2006.
Copyright ©2004 Virtusa Corporation | CONFIDENTIAL ADO.Net Basics Ruwan Wijesinghe Trainer.
Objectives In this lesson, you will learn to: *Identify the need for ADO.NET *Identify the features of ADO.NET *Identify the components of the ADO.NET.
ASP.NET Rina Zviel-Girshin Lecture 5
What is database?  Any Method for access info into Application from DataBase?  ODBC is standard for Accessing Data.  Problem with ODBC:  Information.
3-Tier Client/Server Internet Example. TIER 1 - User interface and navigation Labeled Tier 1 in the following graphic, this layer comprises the entire.
Presented by Joseph J. Sarna Jr. JJS Systems, LLC
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
5-1 VISUAL J++ Colorado Technical University IT420 Tim Peterson.
HNDIT Rapid Application Development
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
1 ADO Activex Data Objects. 2 ADO ADO allows users to access data easily from many existing databases (such as Access or Paradox) From ODBC compliant.
Copyright 2007, Information Builders. Slide 1 iWay Web Services and WebFOCUS Consumption Michael Florkowski Information Builders.
ADO .NET from. ADO .NET from “ADO .Net” Evolution/History of ADO.NET MICROSOFT .NET “ADO .Net” Evolution/History of ADO.NET History: Most applications.
.NET Data Access and Manipulation
 2 Data Object Library approaches ◦ DAO (Data Access Objects)  Original access strategy (up to VB6)  Closely linked to MS Access ◦ ADO (ActiveX Data.
Fundamental of Database Systems
Integrating Data Lesson 6.
ASP.NET Programming with C# and SQL Server First Edition
Data Access with ADO.NET
Introduction to ADO.NET
Introduction to Database Processing with ADO.NET
Introduction to Database Processing with ADO.NET
DBMS & TPS Barbara Russell MBA 624.
VB 2010 Pertemuan 10.
ADO.NET Framework.
Chapter 2 Database System Concepts and Architecture
Programming the Web Using ASP.Net
Lecture 6 VB.Net SQL Server.
IS444: Modern tools for applications development
Active Data Objects Binding ASP.NET Controls to Data
IS444: Modern tools for applications development
VB.NET Using Database.
Tonga Institute of Higher Education
Database Fundamentals
VISUAL BASIC INTRODUCTION TO DATA CONNECTIVITY.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
Analysis models and design models
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Chapter 10 ADO.
Database Applications
Working With Databases
Chapter 10 Accessing Database Files
Active Data Objects Binding ASP.NET Controls to Data
M S COLLEGE OF ART’S, COMM., SCI. & BMS Advance Web Programming
INTRODUCTION A Database system is basically a computer based record keeping system. The collection of data, usually referred to as the database, contains.
Unit – V Data Controls.
Introduction to ADO.Net and Visual Studio Database Tools.
Presentation transcript:

Database Objects 1/12/2019 See scm-intranet

Objective To examine the implementation of objects that use data sources To develop an understanding of the relationship between a client system and a database server 1/12/2019 See scm-intranet

Objects in Database Development An object model, which describes data and processes cannot be converted into a relational schema. However, the development tools used to produce application software which employ a relational database use object oriented ideas-particularly with regard to the user interface. 1/12/2019 See scm-intranet

Question? How can an object based application interact with a non-object based data source e.g a relational database. Answer- By ‘encapsulating’ the data source ‘inside’ an object. Sometimes called ‘wrapping’ the data source. This makes the data source ‘look like’ and ‘behave like’ any other type of object 1/12/2019 See scm-intranet

ADO Object Model ActiveX Data Objects- used in Microsoft environments to manipulate database systems. Capable of manipulating most databases inc. non-Microsoft products. Connects client applications to database servers. Three most important objects are Connection RecordSet Command 1/12/2019 See scm-intranet

Provides a common interface to sources of data. If data source changes e.g. SQL SERVER to ORACLE all application systems remain the same. Assuming systems designed properly i.e. to exploit this capability. An OLE DB provider is required for every potential data source. ADO interfaces to data via a OLE DB provider. 1/12/2019 See scm-intranet

Connection Object   A Connection object, that uses a data link, is required to make and manage the communication between the application and the database management system (DBMS) This may be the same physical machine on which the application executes or a remote server 1/12/2019 See scm-intranet

Objects are Instantiated (created) from Classes. Classes may be pre-defined e.g. by a software supplier, or produced from scratch (programmed). Objects can have An identity Properties Methods Events (for which handling functions can be written) Collections These may be private (not ‘visible’ for use) or public (available for use-the interface between the object and external world) Internal workings of an object private (encapsulation) 1/12/2019 See scm-intranet

Example SQL*Server can be used by running the Query Analyser. The QueryAnalyser is created from objects. When the QueryAnalyser is selected at the PC a dialogue appears which creates an instantiated Connection Object The user has to supply a database server name, a user id, and a password. This information is used to make a Connection String (part of data link) which is then used by the connection object to connect the QueryAnalyser to the database. 1/12/2019 See scm-intranet

1/12/2019 See scm-intranet

1/12/2019 See scm-intranet

Connection String A connection string is a property of a connection object. Object Properties can be ‘set’. This means giving them values. The connection string property is set with basic connection information e.g. user id , password, etc.. 1/12/2019 See scm-intranet

Example Connection Object Properties ConnectionString: defines the database to use, user id and other necessary data. IsolationLevel: defines the degree of locking required on database objects (tables, rows, columns, records) 1/12/2019 See scm-intranet

Example Methods of a Connection Object BeginTrans: Begin a transaction Close: closes a connection with the database Open: opens a connection to database. RollBackTrans: Undo transaction updates. (You can get access to methods by double-clicking a connection object in a Data Environment.) 1/12/2019 See scm-intranet

Example Events of a Connection Object Disconnect: used for operations to be carried out after connection broken ExecuteComplete: used for operations to be carried out after SQL query executed. 1/12/2019 See scm-intranet

RecordSet Object This object holds data that has been requested from a connected database via the OLE DB provider. The object also holds information on that data (meta-data) such as the names of tables and columns, data types and similar. As an object, there are properties, methods and collections which can be accessed and programmed. 1/12/2019 See scm-intranet

Example Properties of Recordset BOF: true if before 1st record CursorLocation:record pointer location EOF:true if after last record MaxRecords:to return from query Source:source of data 1/12/2019 See scm-intranet

Example Methods of RecordSet Close:recordset Delete:current record Movefirst, movelast, Movenext, moveprevious Open:a cursor Update:commit changes 1/12/2019 See scm-intranet

Example Events of RecordSet EndofRecordset:have reached end WillChangeRecordset: something in Recordset will change 1/12/2019 See scm-intranet

Command Object Used for passing queries or data manipulation commands to a connected database. 1/12/2019 See scm-intranet

Example Properties of Command Object ActiveConnection:associated connection object CommandText:command itself 1/12/2019 See scm-intranet

Example Methods of Command Object Cancel:to stop execution Execute:opens a recordset object 1/12/2019 See scm-intranet

ActiveX Data Object (ADO) The ADO is a class/object which can be used to connect to a DBMS and retrieve data   An ADO includes a connection, command and recordset object An ADO object is capable of basic data retrieval and manipulation operations 1/12/2019 See scm-intranet

Association/Aggregation Classes/Objects can be used by other classes/objects. The ways of relating them together are known as abstractions. Association/Aggregation is an abstraction used in object oriented models. In this case, the ADO relates a recordset, command, and connection object. Then adding further functionality (e.g. record browsing) to add value to existing objects. 1/12/2019 See scm-intranet

Instantiation Objects are instantiated from classes This involves setting properties and modifying the parameters of methods This process enables the reusability of components whilst allowing them to be customised to the needs of a specific application So, ADO’s can be instantiated from the ADO class which in turn causes instantiations of command, recordset and connection objects from their respective classes. Hence ADO’s connections, recordsets, and commands are reusable components. 1/12/2019 See scm-intranet

Programming an ADO E.g. Connection objects can be created, opened and closed in a application program It is possible to see Instantiation, method calls and the setting of object properties using a simple example. 1/12/2019 See scm-intranet

Example Application Code-VBasic Private adoConnect as Connection {declaring an object from pre-defined class} Private sub xxx() Set adoConnect=New Connection {Instantiation} AdoConnect.Open “a connection string” {method call} …..database and procedural operations….. AdoConnect.Close {method call} Set adoConnect=Nothing {setting the value of an object property-to remove from memory} End sub 1/12/2019 See scm-intranet

ADO.NET ADO.NET uses some ADO objects, such as the Connection and Command objects, and also introduces new objects. Key ADO.NET objects include Command Connection DataReader DataAdapter DataSet 1/12/2019 See scm-intranet

DataReaders The DataReader object is a read-only/forward-only cursor over data. A DataReader object is returned after executing a command against a database. The format of the returned DataReader object is different from a recordset. For example, you might use the DataReader to show the results of a search list in a web page. 1/12/2019 See scm-intranet

The Dataset is separate and distinct from any data stores. The DataSet functions as a standalone entity. It is an ‘always disconnected’ recordset that knows nothing about the source or destination of the data it contains. Inside a DataSet there are tables, columns, relationships, constraints, views………. The DataSet has the ability to produce and consume XML data 1/12/2019 See scm-intranet

DataAdapter is the object that connects to the database to fill the DataSet. It connects back to the database to update the data, based on operations performed on the DataSet. Provides a bridge to retrieve and save data between a DataSet and its source data store. It accomplishes this by means of SQL commands made against the data store. 1/12/2019 See scm-intranet

Application program Data Reader Data Set Data Adapter OLE DB Database(s) 1/12/2019 See scm-intranet

OLE DB and SQL Server .NET Data Providers The OLE DB and SQL Server .NET Data Providers System.Data.OleDb System.Data.SqlClient are part of the .Net Framework and provide the basic objects 1/12/2019 See scm-intranet

Persistence Objects are made persistent when the application program is saved. Programs are not saved into the database. Programs are saved into program files within the VB environment 1/12/2019 See scm-intranet

The class/object definitions and instantiations are normally stored in the program development environment using project files.  This places them outside the management control of the database management system, unless the program development environment is an integral part of the DBMS (making it an ODBMS?). 1/12/2019 See scm-intranet

Summary An object oriented view can be taken with regard to client applications Application components are instantiated from pre-defined packaged classes Many data sources are not object-oriented so there is an apparent fundamental incompatibility between clients programs and data sources. 1/12/2019 See scm-intranet

Microsoft uses ADO.NET to achieve this. Data sources are encapsulated as objects to be directly compatible with client program objects. Microsoft uses ADO.NET to achieve this. ADO’s consist of an aggregation of objects which manage all connections and interactions with data sources. 1/12/2019 See scm-intranet

(e.g.sharing components in a distributed environment) The application (and components) are made persistent by ‘saving’ into application project files. This method of persistence puts the application components outside the control of the DBMS Putting the components under the control of the DBMS would enhance reusability and configuration management. Software development tools could then use data management tools and techniques to manage components (e.g.sharing components in a distributed environment) 1/12/2019 See scm-intranet