Recent
Articles |
Google Sued Over Alleged Use Of Distributed... Northeastern University has sued Google in the patent-friendly federal court for the Eastern District of Texas, accusing the search giant of infringing upon its work. The University has paired with a startup called...
Oracle Database 11g For Windows Oracle has announced the general availability of Oracle Database 11g for Windows. This version is supposed to be optimized for Windows and .NET. It also includes...
Zoho DB Debuts All that money must be weighing Google and Microsoft down - Zoho has stayed (at least) one step ahead by releasing a unique new online database product, Zoho DB, and initial impressions have been very positive.
Oracle Accelerate For Small & Medium Businesses In October 2006 Oracle launched their Oracle Accelerate Program, according to their Accelerate page... Oracle Accelerate delivers a complete set of applications...
|
|
|
 |
Recent WebProNews Articles |
What Happens In Ask Doesn't Stay In Ask Ask.com isn't being completely forthcoming about its highly touted AskEraser, which, the company promises, deletes searcher data in a matter of hours. Hours seems to be the amount of time required to send that...
Google Frowns On Rogers Injection Rogers Internet in Canada provides its subscribers with an advisory when they are approaching their account's bandwidth limits, by injecting that notice into a web page they are viewing. The example of Rogers dropping...
Google Scrubs SubDomains I had a chance to catch up with Matt Cutts and Vanessa Fox last week at the Las Vegas Pubcon. We talked about a variety of things - from the hacking of someone's out of version WordPress blog to the...
Cutts, Sullivan Weigh In On Paid Links The wild debate about Google's increasingly hardline stance against paid links looks like Wimbledon, with Matt Cutts taking on Rich Skrenta, while Danny Sullivan volleys against Michael Gray. Internet Drama, in the...
|
|
|
|
12.12.07
CFDBINFO & CFZIP For Quick Database Backups
By Raymond Camden
All major database products have tools to let you backup their databases.
MySQL makes it super simple with their command line tools. But what if you want to do it with ColdFusion? Doesn't everyone want to do everything with ColdFusion? I know I do! So let's look at a quick example.
My database backup code will work like so:
1. Get a list of tables from a datasource.
2. Select all rows from the table.
3. Convert the query into WDDX.
4. Zip the giant XML string and store the result.
The code for all this is incredibly simple:
Then I loop over each table and select *. Notice I store the query into the struct. By the way - the cfdbinfo tag also lets you get the columns from a database table. But since this is a "quickie" script, I don't mind using the select *.
The last thing I do is output a simple result message so you know how much data was backed up. Here is the complete source in one listing:
Comments
About the Author:
Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com
Raymond Camden is Vice President of Technology for roundpeg, Inc. A long
time ColdFusion user, Raymond has worked on numerous ColdFusion books
and is the creator of many of the most popular ColdFusion community web
sites. He is an Adobe Community Expert, user group manager, and the
proud father of three little bundles of joy.
|