Database Reference
In-Depth Information
Summary
Today, database applications reside in rich and complicated
environments. In addition to relational databases, there are
nonrelational databases, VSAM and other file-processing
data, e-mail, and other types of data. To ease the job of the
application programmer, various standards have been de-
veloped. The ODBC standard is for relational databases; the
OLE DB standard is for relational databases and other data
sources. ADO was developed to provide easier access to OLE
DB data for the non-object-oriented programmer.
ODBC, or the Open Database Connectivity standard, pro-
vides an interface by which database applications can access
and process relational data sources in a DBMS-independent
manner. ODBC was developed by an industry committee and
has been implemented by Microsoft and many other vendors.
ODBC consists of an applications program, a driver manager,
DBMS drivers, and data source components. Single- and mul-
tiple-tier drivers are defined. The three data source names are
file, system, and user. System data sources are recommended
for Web servers. The process of defining a system data source
name involves specifying the type of driver and the identity of
the database to be processed.
The Microsoft .NET Framework is Microsoft's compre-
hensive application development framework. The current
version is .NET Framework 4.5, which is built on top of the
.NET Framework 2.0 and .NET Framework 3.0 (and their
service pack updates). It includes ADO.NET, ASP.NET, CLR,
and the Base Class Library. Enhancements specific to .NET
Framework 3.5 include the ADO.NET Entity Framework,
which supports the EDM and LINQ. The .NET Framework
4.0 added Parallel LINQ (PLINQ), and the Task Parallel
Library (TPL), and the .NET Framework 4.5 added support
for Windows 8 Apps, including .NET for Windows Store
Apps, Portable class libraries, and the Managed Extensibility
Framework (MEF).
OLE DB is one of the foundations of the Microsoft data
access world. It implements the Microsoft OLE and COM
standards, and it is accessible to object-oriented programs
through those interfaces. OLE DB breaks the features and
functions of a DBMS into objects, thus making it easier for
vendors to implement portions of functionality. Key object
terms are objects, abstractions, properties, methods and col-
lections . A rowset is an abstraction of a recordset, which, in
turn, is an abstraction of a relation. Objects are defined by
properties that specify their characteristics and by methods,
which are the actions they can perform. A collection is an
object that contains a group of other objects. 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
affecting the users of the objects. An interface ought not to
be changed, ever.
Tabular data providers present data in the form of row-
sets. Service providers transform data into another form;
such providers are both consumers and providers of data. A
rowset is equivalent to a cursor. Basic rowset interfaces are
IRowSet, IAccessor, and IColumnsInfo. Other interfaces are
defined for more advanced capabilities.
ADO.NET is a new, improved, and greatly expanded
version of ADO that was developed for the Microsoft .NET
initiative. ADO.NET incorporates all of the functionality of
ADO, but adds much more. In particular, ADO.NET facili-
tates the transformation of XML documents to and from
database data. Most important, ADO.NET introduces the
concept of DataSets, which are in-memory, fully functioned,
independent databases.
A .NET data provider is a library of classes that provides
ADO.NET services. A data provider data reader provides fast,
forward-only access to data. A Command object can be pro-
cessed to execute SQL and also to invoke stored procedures
in a manner similar to but improved from that in ADO. The
major new concept of ADO.NET is the DataSet. A DataSet
is an in-memory database that is disconnected from any
regular database but that has all the important characteris-
tics of a regular database. DataSets can have multiple tables,
relationships, referential integrity rules, referential integrity
actions, views, and the equivalent of triggers. DataSet tables
may have surrogate key columns (called auto-increment col-
umns) and primary keys and may be declared unique.
DataSets are disconnected from the database(s) from
which they are constructed, and they may be constructed
from several different databases and possibly managed by
different DBMS products. After a DataSet is constructed, an
XML document of its contents and an XML Schema of its
structure are easily produced. Further, the process works in
reverse as well. XML Schema documents can be read to cre-
ate the structure of the DataSet, and XML documents can be
read to fill the DataSet.
DataSets are needed to provide a standardized, non-
proprietary means to process database views. They are es-
pecially important for the processing of views with multiple
multivalued paths. The potential downside of DataSets is
that because they are disconnected, any updates against the
databases they access must be performed using optimistic
locking. In the case of conflict, either the DataSet must be
reprocessed or the data change must be forced onto the da-
tabase, causing the lost update problem.
 
 
Search WWH ::




Custom Search