Preparing to Write SQL Queries


Now that you have a data source, all you need is a client application with which to access the data. Ultimately, the client you will use is ColdFusion via CFML code; after all, that is why you're reading this book. But to start learning SQL, we'll use something simpler, a SQL Query Tool (written in ColdFusion). The tool is named sql.cfm and is in a directory named sql under the ows directory, and so the path to it (if using the integrated Web server) will be:

http://localhost:8500/ows/sql/sql.cfm

NOTE

If you are using the integrated server in a multi-server installation, use port 8300 instead of 8500.


The SQL Query Tool, shown in Figure 6.11, allows you to enter SQL statements in the box provided; they are executed when the Execute button is clicked. Results are displayed in the bottom half of the screen.

Figure 6.11. The SQL Query Tool allows SQL statements to be entered manually and then executed.


CAUTION

The SQL Query Tool is provided here as a convenience to you. It's not for use on development computers and should never be installed on live (production) servers.


NOTE

The SQL Query Tool allows SQL statements to be executed against databases. This type of tool is dangerous, as it could be used to delete or change data (accidentally or maliciously). To help prevent this, SQL Query Tool has several built-in security measures: by default it only allows SELECT statements; it has a hard-coded data source; and it only allows SQL statements to be executed locally (local IP address only). To use SQL Query Tool remotely, you must explicitly allow your own IP address access to the tool by modifying the Application.cfm file specifying the address in the ip_restrict variable.




Macromedia Coldfusion MX 7 Web Application Construction Kit
Macromedia Coldfusion MX 7 Web Application Construction Kit
ISBN: 321223675
EAN: N/A
Year: 2006
Pages: 282

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net