Computer Programming/Database Programming

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Database Programming[edit | edit source]

Introduction[edit | edit source]

A database is a repository of information managed by a database engine which ensures integrity of data and fast access to the data.

A very common implementation of a database is a Relational Database Management System (RDBM). To users, the information in a database can be accessed by using Structured Query Language (SQL) a database language common to most databases. However, SQL only provides commands to access and manipulate the data in the database.

For any complex application, there commonly is a need for conditions, branching, and loops. None of these are a part of the SQL language. In order to fill this gap, many common programming languages allow integration with SQL through a common library such as Open Data Base Connectivity (ODBC), Object Linking and Embedding (OLE), and sometimes with application programming interfaces or libraries supplied with the database.

In addition, most databases now have a simple language of their own which allows simple control for applications which do not need the full power of standard languages like C++ and Pascal. These simple languages are used to write stored procedures and are proprietary to each database.

An alternate approach taken by other languages like MUMPS is to have a data model that includes persistent variables that are shared among multiple processes. This approach hides the database operations within the programming language instead of hiding the language within the database.

Stored procedure languages[edit | edit source]