Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Connectivity and Web Technologies

Similar presentations


Presentation on theme: "Database Connectivity and Web Technologies"— Presentation transcript:

1 Database Connectivity and Web Technologies
Database Principles Constructed by Hanh Pham based on slides from: “Database Processing, Fundamentals, Design, and Implementation”, D. Kroenke, D. Auer, Prentice Hall “Database Principles: Fundamentals of Design, Implementation, and Management”, C. Coronel, S. Morris, P.Rob Database Connectivity and Web Technologies

2 Outlines Database connectivity technologies
ODCB .NET and OLE DAO and ADO JDBC How Web-to-database middleware is used to integrate databases with the Internet Web browser plug-ins and extensions What services are provided by Web application servers What Extensible Markup Language (XML) is and why it is important for Web database development About cloud computing and how it enables the database-as-a-service model

3 Database Connectivity
Mechanisms by which application programs connect and communicate with data sources Also known as database middleware Data repository: Also known as a data source Represents the data management application Used to store data generated by an application program ODBC, OLE-DB, ADO.NET: the backbone of MS Universal Data Access (UDA) architecture

4 Connection to Database Servers
Because database applications today reside in a complicated environment, various standards have been developed for accessing database servers. Some of the important standards: ODBC (Open Database Connectivity) is the early standard for relational databases. OLE DB is Microsoft’s older object-oriented interface for relational and other databases. The .NET Framework and ADO.NET are the current Microsoft “dot NET” data access standards providing easier access to data. JBDC (Java Database Connectivity) is the Java “equivalent” of ODBC. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

5 Web Server Data Environment
a Web server needs to publish applications (at browsers) that involve different data types.

6 Native SQL Connectivity
Connection interface provided by database vendors Unique to each vendor Example: Oracle RDBMS Must install and configure Oracle’s SQL*Net interface in client computer Interfaces optimized for particular vendor’s DBMS Maintenance is a burden for the programmer

7

8 Outlines ODCB

9 ODBC The ODBC (Open Database Connectivity) standard provides a DBMS-independent means for processing relational database data. It was developed in the early 1990s by an industry committee and has been implemented by Microsoft and many other vendors. The goal is to allow a developer to create a single application that can access databases supported by different DBMS products without needing to be changed or recompiled. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

10 ODBC Open Database Connectivity (ODBC)
Microsoft’s implementation of a superset of SQL Access Group Call Level Interface (CLI) Widely supported database connectivity interface Any Windows application can access relational data sources Uses SQL via standard application programming interface (API)

11 The Role of the ODBC Standard

12 ODBC architecture Basic ODBC architecture has three main components:
High-level ODBC API through which application programs access ODBC functionality Driver manager that is in charge of managing all database connections ODBC driver that communicates directly to DBMS

13

14 ODBC Layers KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

15 ODBC Components ODBC consists of a data source, an application program, a driver manager, and a DBMS driver. A data source is the database, its associated DBMS, operating system, and network platform. An ODBC data source can be a relational database, a file server, or a spreadsheet. An applications program issues requests to create a connection with a data source. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

16 ODBC Components A driver manager determines the type of DBMS for a given ODBC data source and loads that driver in memory. A DBMS driver processes ODBC requests and submits specific SQL statements to a given type of data source. A single-tier driver processes both ODBC calls and SQL statements. A multiple-tier driver processes ODBC calls, but passes the SQL requests to the database server. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

17 ODBC Driver Types: ODBC Single-Tier Driver
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

18 ODBC Driver Types: ODBC Multiple-Tier Driver
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

19 Conformance Levels Levels of conformance balance the scope of the ODBC standard. There are two types of conformance levels: ODBC conformance levels concern the features and functions that are made available through the driver’s application program interface (API). A driver API is a set of functions that the application can call to receive services. SQL conformance levels specify which SQL statements, expressions, and data types a driver can process. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

20 ODBC Conformance Levels
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

21 SQL Conformance Levels
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

22 ODBC Data Source A data source is an ODBC data structure that identifies a database and the DBMS that processes it. Three types of data source names: A file data source is a file that can be shared among database users having the same DBMS driver and privilege. A system data source is local to a single computer and may be used by the operating system and any user on that system. System data sources are recommended for Web servers. To define a system data source name, the type of driver and the database need to be specified. A user data source is available only to the user who created it. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

23 Creating a System Data Source I
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

24 Creating a System Data Source II
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

25 Creating a System Data Source III
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

26 Creating a System Data Source IV
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

27 Creating a System Data Source V
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

28 Creating a System Data Source VI
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

29 Creating a System Data Source VII
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

30 Creating a System Data Source VIII
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

31 32-Bit versus 64-Bit ODBC I The ODBC Data Sources program we have been using is for the 64-bit version of the ODBC data sources administration program, and will create 64-bit ODBC data sources. These will only work as long as every component in the Web application program chain is a 64-bit program. But, if any component is a 32-bit program, the 64-bit ODBC data source will not work. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

32 32-Bit versus 64-Bit ODBC II
In fact, when you are building the Web database applications in this chapter, if everything seems to be correctly done but the system still does not work, the most likely cause is a 32-bit program in the chain. To resolve this problem, you will need to use the 32-bit version of the ODBC Data Sources program located at C:\Windows\SysWOW64\odbcad32.exe. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

33 32-Bit versus 64-Bit ODBC III
To resolve your Web database application problem, create a 32-bit ODBC data source using ODBC Administrator, and then revise your Web page code to use that ODBC data source. For more information on the programs in the Windows\SysWOW64 folder, see the Wikipedia article on WoW64at en.wikipedia.org/wiki/WoW64. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

34 32-Bit versus 64-Bit ODBC IV
The two icons for the two versions appear as shown below. Note that although the program icons are the same, the program names are different. Data Source (ODBC ) is the 64-bit version, and ODBC Administrator is the 32-bit versions. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

35 Outlines .NET and OLE

36 The Microsoft .NET Framework
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

37 OLE DB Object Linking and Embedding (OLE) for Database (DB)
OLE DB is an implementation of the Microsoft OLE object standard. OLE DB breaks the features and functions of a DBMS into COM objects, making it easier for vendors to implement portions of functionality. This characteristic overcomes a major disadvantage of ODBC. With ODBC, a vendor must create an ODBC driver for almost all DBMS features and functions in order to participate in ODBC at all. Database middleware that adds object-oriented functionality for access to data Series of COM objects provides low-level database connectivity for applications KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

38 The Role of OLE DB KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

39

40 Object-Oriented Concepts
An object-oriented programming object is an abstraction that is defined by its properties and methods. An abstraction is a generalization of something. A property specifies a set of characteristics of an object. A method refers to actions that an object can perform. A collection is an object that contains a group of other objects. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

41 OLE DB Goals Create object interfaces for DBMS functionality pieces:
Query, update, transaction management, etc. Increase flexibility: Allow data consumers to use only the objects they need Allow data providers to expose pieces of DBMS functionality Providers can deliver functionality in multiple interfaces Interfaces are standardized and extensible Provide object interfaces over any type of data: Relational and non-relational database, ODBC or native, VSAM and other files, , etc. Do not force data to be converted or moved from where it is KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

42 OLE DB Basic Constructs
There are data consumers and data providers: Data consumers—users of OLE DB functionality. Data providers—sources of OLE DB functionality. An interface is a set of objects and the properties and methods they expose in that interface: Objects may expose different properties and methods in different interfaces. An implementation is how an object accomplishes its tasks: Implementations are hidden from the outside world and may be changed without impacting the users of the objects. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

43 OLE DB Data Providers OLE DB has two types of data providers:
A rowset is equivalent to a cursor. OLE DB has two types of data providers: Tabular data provider—exposes data via rowsets Examples: DBMS, spreadsheets, ISAMs Service provider—a transformer of data through OLE DB interfaces It is both a consumer and a provider of transformed data. Examples: query processors, XML document creator KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

44 Rowset Interfaces KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

45 Outlines DAO, RDO and ADO

46 DAO Data Access Objects (DAO) Object-oriented API
Accesses MS Access, MS FoxPro, and dBase databases from Visual Basic programs Provided an optimized interface that exposed functionality of Jet data engine to programmers DAO interface can also be used to access other relational style data sources

47 RDO Remote Data Objects (RDO)
Higher-level object-oriented application interface used to access remote database servers Uses lower-level DAO and ODBC for direct access to databases Optimized to deal with server-based databases, such as MS SQL Server, Oracle, and DB2 Implemented as shared code dynamically linked to Windows via dynamic-link libraries

48

49 ADO.NET Data access component of Microsoft’s .NET application development framework Two new features for development of distributed applications: DataSet is disconnected memory-resident representation of database DataSet is internally stored in XML format Data in DataSet made persistent as XML documents

50

51 ADO.NET (cont’d.) Specific objects manipulate data in data source
Connection Command DataReader DataAdapter DataSet DataTable

52 The Role of ADO KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

53 The Role of ADO.NET KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

54 Data Provider A .NET data provider is a library of classes that provides ADO.NET services. Microsoft’s provides three data providers: OLE DB data provider can be used to process any OLE DB-compliant data source. SQL Server Client data provider is purpose-built for use with SQL Server. Oracle Database Client data provider is purpose-built for use with Oracle Database. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

55 Data Provider Components
A connection object is similar to the ODBC’s connection object. A command object is created on an established connection. A data reader provides read-only, forward-only, fast access to database data. An application can get and put data to and from the database using the command object. A DataSet is an in-memory database that is disconnected from any regular database. It distinguishes ADO.NET from the previous data access technology. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

56 Data Provider Components
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

57 The ADO.NET DataSet A DataSet is an in-memory database that is disconnected from any regular database. DataSets can have: Multiple tables, views, and relationships. Tables may have surrogate key (auto increment columns), primary keys, and be declared as unique. Referential integrity rules and actions. The equivalent of triggers. DataSets may be constructed from several different databases and managed by different DBMS. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

58 The ADO.NET Object Model
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

59 The ADO.NET Dataset Object Model
KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

60 DataSet Advantages DataSet contents and its XML schema can be easily formatted as an XML document. Also, XML schema documents can be read to create the structure of the dataset, and XML documents can be read to fill the dataset. DataSets are needed to provide a standardized, nonproprietary means to process database views. This is important for the processing of views with multiple multivalue paths. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

61 DataSet Disadvantages
Because DataSet data is disconnected from the regular database, only optimistic locking can be used when updating the regular database with the DataSet. In the case of conflict, either the dataset must be reprocessed or the data change must be forced onto the database, causing the lost update problem. Thus, datasets cannot be used for applications in which optimistic locking is problematical. Instead, the ADO.NET command object should be used. KROENKE AND AUER - DATABASE PROCESSING, 12th Edition © 2012 Pearson Prentice Hall

62 OLE-DB, ADO, DAO and RDO OLE-DB did not provide support for scripting languages ActiveX Data Objects (ADO) provides high-level application-oriented interface to interact with OLE-DB, DAO, and RDO ADO provides unified interface to access data from any programming language that uses the underlying OLE-DB objects

63 Outlines JDBC

64 Java Database Connectivity (JDBC)
Java is an object-oriented programming language Runs on top of Web browser software Advantages of JDBC: Company can leverage existing technology and personnel training Allows direct access to database server or access via database middleware Provides a way to connect to databases through an ODBC driver

65

66 Outlines How Web-to-database middleware is used to integrate databases with the Internet

67 Database Internet Connectivity
Web database connectivity allows new innovative services that: Permit rapid response by bringing new services and products to market quickly Increase customer satisfaction through creation of Web-based support services Allow anywhere, anytime data access using mobile smart devices via the Internet Yield fast and effective information dissemination through universal access

68

69 Web-to-Database Middleware: Server-Side Extensions
Web server is the main hub through which Internet services are accessed Dynamic Web pages are at the heart of current generation Web sites Server-side extension: a program that interacts directly with the Web server Also known as Web-to-database middleware Middleware must be well integrated

70

71 Web Server Interfaces Two well-defined Web server interfaces:
Common Gateway Interface (CGI) Application Programming Interface (API) Disadvantage of CGI scripts: Loading external script decreases system performance Language and method used to create script also decrease performance API is more efficient than CGI API is treated as part of Web server program

72

73 The Web Browser Software that lets users navigate the Web
Located in client computer Interprets HTML code received from Web server Presents different page components in standard way Web is a stateless system: Web server does not know the status of any clients

74 Client-Side Extensions
Add functionality to Web browser Three general types: Plug-ins Java and JavaScript ActiveX and VBScript

75 Client-Side Extensions (cont’d.)
Plug-in: an external application automatically invoked by the browser when needed Java and JavaScript: embedded in Web page Downloaded with the Web page and activated by an event ActiveX and VBScript: embedded in Web page Downloaded with page and activated by event Oriented to Windows applications

76 Web Application Servers
Middleware application that expands the functionality of Web servers Links them to a wide range of services Some uses of Web application servers: Connect to and query database from Web page Create dynamic Web search pages Enforce referential integrity Some features of Web application servers: Security and user authentication Access to multiple services

77 Web Database Development
Process of interfacing databases with the Web browser Code examples ColdFusion PHP

78

79

80 Extensible Markup Language (XML)
Companies use Internet to create new systems that integrate their data Increase efficiency and reduce costs Electronic commerce enables organizations to market to millions of users Most e-commerce transactions take place between businesses HTML Web pages display in the browser Tags describe how something looks on the page

81 Extensible Markup Language (XML) (cont’d.)
Metalanguage to represent and manipulate data elements Facilitates exchange of structured documents over the Web Allows definition of new tags Case sensitive Must be well-formed and properly nested Comments indicated with <- and -> XML and xml prefixes reserved for XML tags only

82

83 Document Type Definitions (DTD) and XML Schemas
Document Type Definition (DTD) File with .dtd extension that describes elements Provides composition of database’s logical model Defines the syntax rules or valid tags for each type of XML document Companies engaging in e-commerce transaction must develop and share DTDs DTD referenced from inside XML document

84

85 Document Type Definitions (DTD) and XML Schemas (cont’d.)
Advanced data definition language Describes the structure of XML data documents Advantage of XML schema: More closely maps to database terminology and features XML schema definition (XSD) file uses syntax similar to XML document

86 XML Presentation XML separates data structure from presentation and processing Extensible Style Language (XSL) displays XML data Defines the rules by which XML data are formatted and displayed Two parts: Extensible Style Language Transformations (XSLT) XSL style sheets

87

88

89

90 XML Applications B2B exchanges Legacy systems integration
Web page development Database support Database meta-dictionaries XML databases XML services

91 Cloud Computing Services
“A computing model for enabling ubiquitous, convenient, on-demand network access to a shared pool of configurable computer resources that can be rapidly provisioned and released with minimal management effort or service provider interaction.” Potential to become a “game changer”

92

93 Cloud Implementation Types
Public cloud Private cloud Community cloud

94 Characteristics of Cloud Services
Ubiquitous access via Internet technologies. Shared infrastructure Lower costs and variable pricing Flexible and scalable services Dynamic provisioning Service orientation Managed operations

95 Types of Cloud Services
Software as a Service (SaaS) Platform as a Service (PaaS) Infrastructure as a Service (IaaS)

96 Cloud Services: Advantages and Disadvantages

97 SQL Data Services Cloud computing data management service
Provides relational data management to companies of any size Avoids high cost of personnel/maintenance Leverages Internet to provide: Hosted data management Standard protocols A common programming interface Could assist businesses with limited information technology resources

98 Summary Database connectivity:
Ways in which programs connect and communicate with data repositories Database connectivity software known as database middleware Database repository also known as data source Represents data management application used to store data generated by the program Microsoft interfaces are dominant players ODBC, OLE-DB, ADO.NET

99 Summary (cont’d.) Microsoft’s Universal Data Access (UDA) architecture
Collection of technologies to access any type of data source using common interface Native database connectivity: interface provided by database vendor ODBC is Microsoft's implementation of SQL Access Group Call Level Interface Allows any Windows application to access relational data sources using SQL

100 Summary (cont’d.) OLE-DB adds object-oriented functionality for access to data ActiveX Data Objects provide interface with OLE-DB, DAO, and RDO ADO.NET is data access component of Microsoft .NET framework Java Database Connectivity (JDBC) interfaces with Java applications with data sources

101 Summary (cont’d.) Database access through the Web uses middleware
On client side of Web browser, use plug-ins, Java and JavaScript, ActiveX, and VBScript On server side, middleware expands functionality of Web servers Links them to wide range of services XML provides semantics to share structured documents across the Web Produces description and representation of data

102 Summary (cont’d.) Cloud computing SQL data services (SDS)
Computing model that provides ubiquitous, on-demand access to a shared pool of configurable resources that can be rapidly provisioned SQL data services (SDS) Cloud computing-based data management service that provides relational data storage, ubiquitous access, and local management to companies of all sizes


Download ppt "Database Connectivity and Web Technologies"

Similar presentations


Ads by Google