Web DevCenter
oreilly.comSafari Books Online.Conferences.
MySQL Conference and Expo April 14-17, 2008, Santa Clara, CA

Sponsored Developer Resources

Web Columns
Adobe GoLive
Essential JavaScript

Web Topics
All Articles
Scripting Languages

Atom 1.0 Feed RSS 1.0 Feed RSS 2.0 Feed

Learning Lab

ColdFusion MX on Mac OS X, Part 4
Pages: 1, 2, 3

17. The Select schema window shows two items: PBPUBLIC and POINTBASE. The PointBase item will display system components available in the entire PointBase system. The PBPUBLIC item will display everything that is available to the PBPUBLIC user for this database. (Many database systems allow different users to have different access privileges to the same database.) Select the PBPUBLIC item to display the components defined to the creator of the currently-connected (CFSnippets) database. Click OK. The Schema PBPUBLIC window pops up.

18. In the Schema PBPUBLIC window, click the Employees Table in the left pane; the right pane changes to display the definitions for the Employees Table.

19. Move the Schema PBPUBLIC window to the side so we can view both it and the Main ViennaSQL window.

20. In the main ViennaSQL window, enter the following SQL Query into the bottom pane. Then click the Execute (right arrow) icon (top, fifth from the left).

SELECT    LastName, FirstName, Phone
FROM      Employees
WHERE     Department='Sales'
ORDER BY  LastName, FirstName

21. The query results are shown in the upper pane.

We have only scratched the surface of the powerful, general-purpose ViennaSQL GUI SQL client. We can develop and test our SQL queries, interactively, against test or live data. Once the queries are validated, we can literally copy/paste them to our CFMX programs. The Query we just executed was our (soon-to-be famous) Phone List.

There is much more you can do with ViennaSQL: create databases, create or alter tables, create views, etc. (depending on the capability of the specific database system). A more comprehensive treatment of ViennaSQL is beyond the scope of this article, but I suggest you review the documentation and spend some time experimenting with the program. It is time well invested and will be paid back many times over.

It needs to be said that using a powerful, interactive tool like ViennaSQL requires a certain discipline. It is possible, with a few keystrokes, to irretrievably delete (or modify) all of the records in a table, or even drop entire databases. Proceed responsibly!

I should also note that CFMX, ViennaSQL, and other programs can access the databases concurrently -- though some database systems may not support advanced RDBMS features such as transaction isolation, locking, rollback, and deadlock detection/avoidance. CFMX contains features that help prevent problems that can occur with concurrent database access and modification; other languages may not offer similar protection. My advice? You should limit your concurrent database access and modifications to the lowest-common-denominator of what is supported by the underlying database system and the individual programs and programming languages used to access it.

We will not cover the setup of ViennaSQL connections for each individual database system that we interface from this point on. But the procedure is the same for each database -- only the connection details are different. The connection details can be copy/pasted between the CFMX Administrator and ViennaSQL Connection configurator. If you plan to use the database at all, take a few moments and set up a ViennaSQL connection.

Where Do We Go from Here?

There are quite a few other databases that can be interfaced to our CFMX Mac OS X developer system, and many other related topics that we can explore. Here's your chance to contribute! Below is a list of topics that are on the "To Do" list. We want you, the readers, to prioritize them for us. If you don't see the topic you want, feel free to add to the list.

  1. Use the >> and << buttons to move topics between Available and Chosen Topics.
  2. Use the Up and Dn buttons to change priority of Chosen Topics.
  3. Use the New Topic button and text box to enter a New Topic.
  4. When finished, email your selection with the Send Your Topic List button.
Available Topics   Chosen Topics, Prioritized  




Dick Applebaum has been doing Web development since 1997, primarily with ColdFusion -- including his latest challenge to port ColdFusion MX to Mac OS X.

Return to the Web Development DevCenter.