Chapter 6: The Database Api; How Database Api Functions Work - MACROMEDIA DREAMWEAVER 8-DREAMWEAVER API Reference

Dreamweaver api reference
Table of Contents

Advertisement

CHAPTER 6
The Database API
Functions in the Database API let you manage database connections and access information
that is stored in databases. The Database API is divided by two distinct purposes: managing
and accessing database connections.
In managing database connections, you can get the user name and password needed to make a
connection to a database, open up a database connection dialog box, and so on.
In accessing database information, you can, for example, retrieve metadata that describes the
schema or structure of a database. This metadata includes information such as the names of
tables, columns, stored procedures, and views. You can also show the results of executing a
database query or stored procedure. When accessing a database through this API, you use
structured query language (SQL) statements.
Database API functions are used at design time when users are building web applications, not
at runtime when the web application is deployed.
You can use these functions in any extension. In fact, the Macromedia Dreamweaver 8
Server Behavior, Data Format, and Data Sources API functions all use these database
functions.

How Database API functions work

The following example shows how the server behavior function,
defined for Recordset.js. This example uses the
function getDynamicBindings(ss)
{
var serverModel = dw.getDocumentDOM().serverModel.getServerName();
var bindingsAndTypeArray = new Array();
var connName
=
ss.connectionName;
var statement = ss.source;
var rsName
= ss.rsName;
// remove SQL comments
statement = statement.replace(/\/\*[\S\s]*?\*\//g, " ");
getDynamicBindings()
MMDB.getColumnAndTypeList()
6
, is
function:
69

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER 8-DREAMWEAVER API and is the answer not in the manual?

This manual is also suitable for:

Dreamweaver 8

Table of Contents