12.07.2015 Views

DB2 data manipulation

DB2 data manipulation

DB2 data manipulation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

developerWorks®ibm.com/developerWorks• Stored procedures• User-defined functions• TriggersThe key advantage in transferring logic focused on <strong>data</strong> from the application to the<strong>data</strong>base is that your application becomes more independent of the <strong>data</strong>. The logicsurrounding your <strong>data</strong> is centralized in one place, the <strong>data</strong>base. This means that youcan change <strong>data</strong> or <strong>data</strong> logic once and affect all applications that depend on that<strong>data</strong> immediately.This latter advantage is very powerful, but you must also consider that any <strong>data</strong> logicput into the <strong>data</strong>base affects all users of the <strong>data</strong> equally. You must considerwhether the rules and constraints that you wish to impose on the <strong>data</strong> apply to allusers of the <strong>data</strong> or just the users of a single application.Your application requirements may also help you decide whether to enforce rules atthe <strong>data</strong>base or at the application. For example, you may need to process validationerrors on <strong>data</strong> entry in a specific order. In general, you should do this type of <strong>data</strong>validation in the application code. You should also consider the computingenvironment where the application is used. You need to consider the differencebetween performing logic on the client machines and running the logic on the(usually more powerful) <strong>data</strong>base server machines using either stored procedures,user-defined functions (UDFs), or a combination of both. In some cases, the correctapproach is to include enforcement in both the application (perhaps due toapplication-specific requirements) and in the <strong>data</strong>base (perhaps due to otherinteractive uses outside the application).Access <strong>data</strong>In a relational <strong>data</strong>base, you must use SQL to access your desired <strong>data</strong>. However,you have a choice as to how to integrate that SQL into your application. You canchoose from the following interfaces and their supported languages:• Embedded SQL• C/C++• COBOL• FORTRAN• The Java® language (through SQLJ or JDBC)• REXX• <strong>DB2</strong> CLI and ODBC• Microsoft specifications, including ADO.NET and OLE DB• Visual Basic, Visual C++ , and .NET languages<strong>DB2</strong> <strong>data</strong> <strong>manipulation</strong>Page 4 of 25© Copyright IBM Corporation 1994, 2007. All rights reserved.

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

Saved successfully!

Ooh no, something went wrong!