09.01.2013 Views

RAD Studio for Microsoft .NET - Embarcadero Technologies

RAD Studio for Microsoft .NET - Embarcadero Technologies

RAD Studio for Microsoft .NET - Embarcadero Technologies

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

1.1 Developing Database Applications with <strong>RAD</strong> <strong>Studio</strong> <strong>for</strong> <strong>Microsoft</strong> .<strong>NET</strong> Stored Procedure Overview<br />

• Borland.Data.AdoDbxClientProvider<br />

• Borland.Data.Common<br />

• Borland.Data.Schema<br />

• Borland.Data.Design<br />

AdoDbx.<strong>NET</strong> Data Types<br />

AdoDbx.<strong>NET</strong> maps SQL data types to .<strong>NET</strong> Framework data types, eliminating the need <strong>for</strong> you to learn a database-specific<br />

type system. Every attempt has been made to implement consistent type mappings across database types, allowing you to write<br />

one set of source that you can run against multiple databases. You can achieve a similar effect with the .<strong>NET</strong> Framework data<br />

providers by communicating with their interfaces directly and by using untyped ancestors. However, once you use strongly typed<br />

accessors, your application becomes less portable. AdoDbx.<strong>NET</strong> does not support any database-specific typed accessors. For<br />

more in<strong>for</strong>mation, see the AdoDbx.<strong>NET</strong> Data Types topic.<br />

AdoDbx.<strong>NET</strong> Interfaces<br />

You can extend AdoDbx.<strong>NET</strong> to support other DBMSs by implementing a subset of the .<strong>NET</strong> Provider interface. AdoDbx.<strong>NET</strong><br />

generalizes much of the functionality required to implement data providers. While the .<strong>NET</strong> Framework gives you the capabilities<br />

to create individual data providers <strong>for</strong> each data source, CodeGear has simplified the task by offering a generalized set of<br />

capabilities. Instead of building separate providers, along with corresponding DataAdapters, DataReaders, Connection objects,<br />

and other required objects, you can implement a set of AdoDbx.<strong>NET</strong> interfaces to build your own data source plug-ins to the<br />

AdoDbx Client Provider.<br />

Building plug-ins is a much easier task than building a completely new data provider. You build an assembly that contains the<br />

namespace <strong>for</strong> your provider, as well as classes that encapsulate provider-specific functionality. Much of the functionality you<br />

need to connect to, execute commands against, and retrieve data from your data source has already been defined in the<br />

AdoDbx Client Provider interfaces.<br />

See Also<br />

ADO.<strong>NET</strong> Overview ( see page 14)<br />

AdoDbx.<strong>NET</strong> Component Designers ( see page 21)<br />

AdoDbx.<strong>NET</strong> Data Types ( see page 11)<br />

1.1.10 Stored Procedure Overview<br />

All relational databases have certain features in common that allow applications to store and manipulate data. A stored<br />

procedure is a self-contained program written in a language specific to the database system. A stored procedure typically<br />

handles frequently repeated database-related tasks, and is especially useful <strong>for</strong> operations that act on large numbers of records<br />

or that use aggregate or mathematical functions. Stored procedures are typically stored on the database server.<br />

Calling a stored procedure is similar to invoking a SQL command, and <strong>RAD</strong> <strong>Studio</strong> provides support <strong>for</strong> using stored procedures<br />

in much the same ways as it supports editing and using SQL command text.<br />

Stored procedures can enhance your database applications in the following ways: improve the per<strong>for</strong>mance, security, and<br />

reliability of your applications.<br />

• Per<strong>for</strong>mance—stored procedures can improve the per<strong>for</strong>mance of a database application by taking advantage of the server’s<br />

usually greater processing power and speed, and reducing network traffic by moving processing to the server. Also, the<br />

compiled SQL used in a stored procedure executes faster typically than standard SQL command text.<br />

• Security—by creating a layer between clients and the database, stored procedures can enhance security <strong>for</strong> your data. You<br />

don't need to grant database permissions to individual users. Instead, you can grant users permission to execute a stored<br />

procedure independently of underlying table permissions.<br />

29<br />

1

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!