ColdFusion, AJAX and web...
DbEdit is a set of plugins for the Eclipse Platform that provide viewing, editing and designing capabilities using the JDBCTM API. It is not intended to replace any proprietary database management tool because it surely cannot beat them because the JDBCTM API has several limitations. Currently there are the following functionalities:I got it up and running very quickly. I ended up downloading the Microsoft JDBC drivers for SQL Server. Now I don't have to have an instance of Query Analyzer or Enterprise Manager open just to do quick lookups. The decreased memory usage of not doing so also helps!http://eclipse-plugins.2y.net/eclipse/plugin_details.jsp?id=458
- direct table data manipulation using the Table Editor
- editing and executing of SQl statements using the SQL Editor
- exploring database structure using the Tables View
- scanning tables for search patterns with Eclipse integrated database Search Support
- exporting and importing table DDL and content using Eclipse integrated Export/Import feature
- compare tables using the table comparison
- explore a schema's referential structure using the Visual Editor
Backbase provides Rich Internet Application software that radically improves the usability and effectiveness of online applications, and increases developer productivity. With Backbase you can build web applications with a richer and more responsive user experience.There are some pretty cool examples on the site, including some very "flash-like" demos.
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate. http://www.json.org/The purpose of this example is to show you how easy it is to get data from the server without refreshing the page. It would even be easier if I used one of the AJAX libraries out there. display.html This is a sample HTML page that contains the empty table ready for population. Clicking on the "call getArtists..." link performs an asynchronous call which gets the data from ColdFusion and then populates the table.
<html>
<head>
<title>JSON Test</title>
<script src="artists.js"></script>
</head>
<body>
<a href="javascript:getArtists()">Call getArtists() method -- appends to table!</a>
<br/><br/>
<table id="artistTable">
<caption>Artists</caption>
<thead>
<tr>
<td>ID</td>
<td>Last Name</td>
<td>First Name</td>
<td>City</td>
</tr>
</thead>
</table>
<script>
getArtists();
</script>
</body>
</html>
artists.js
This JavaScript file contains methods that will dynamically create the SCRIPT tag. The src attribute of the SCRIPT tag is the getData.cfm ColdFusion template, which creates the JSON data.
The populateUI method (which populates the table with the data) is only called once the SCRIPT tag's readyState has changed to "loaded" (e.g. the data has loaded).
The only change I had to make was the loop over the data. I now use the RECORDCOUNT for the loop condition, and reference the columns of each query row using struct of array notation.
function getDataFromServer(id, url, callback)
{
var oScript = document.getElementById(id);
var head = document.getElementsByTagName("head").item(0);
if (oScript)
{
// Destory object
head.removeChild(oScript);
// Create object
oScript = document.createElement("script");
}
else
{
// Create object
oScript = document.createElement("script");
}
var dtRf = new Date();
oScript.setAttribute("src",url + "?rf=" +dtRf.getTime());
oScript.setAttribute("id",id);
head.appendChild(oScript);
if (oScript.readyState!="loaded")
{
oScript.onreadystatechange = function()
{
if (this.readyState == "loaded")
{
eval(callback);
oScript.onreadystatechange = null;
}
}
}
else
{
alert('Cannot load data!');
}
}
function getArtists()
{
getDataFromServer("artistData","getData.cfm","populateUI()");
}
function populateUI()
{
oTable = document.getElementById("artistTable");
// Loop over the data
for (var i=0; i < QARTISTS.RECORDCOUNT; i++)
{
// Create a new TR element
oTR = oTable.insertRow();
// Create a call for each element in struct
oTD = oTR.insertCell();
oTD.innerHTML = QARTISTS.DATA.ARTISTID[i];
oTD = oTR.insertCell();
oTD.innerHTML = QARTISTS.DATA.LASTNAME[i];
oTD = oTR.insertCell();
oTD.innerHTML = QARTISTS.DATA.FIRSTNAME[i];
oTD = oTR.insertCell();
oTD.innerHTML = QARTISTS.DATA.CITY[i];
}
}
getData.cfm
This a ColdFusion template that performs a query on the database, and then encodes the ColdFusion variable as JSON data. json.cfm contains the jsonencode UDF.
<cfsetting enablecfoutputonly="true">
<cfinclude template="json.cfm" />
<cfquery datasource="cfartgallery" name="qData">
SELECT *
FROM artists
ORDER BY lastname, firstname
</cfquery>
<cfoutput>QARTISTS = #jsonencode(qData)#;</cfoutput>
The W3C DOM specification provides a very rich and intuitive structure for housing the XML data, but can be quite resource-intensive given that the entire XML document is typically stored in memory. You can manipulate the DOM at run-time and stream the updated data as XML, or transform it to your own format if you require. The strength of the SAX specification is that it can scan and parse gigabytes worth of XML documents without hitting resource limits, because it does not try to create the DOM representation in memory. Instead, it raises events that you can handle as you see fit. Because of this design, the SAX implementation is generally faster and requires fewer resources. On the other hand, SAX code is frequently complex, and the lack of a document representation leaves you with the challenge of manipulating, serializing, and traversing the XML document. http://www.devx.com/xml/Article/16922/0/page/2
CFJSON is a ColdFusion implementation of the JSON data format. JSON is a lightweight replacement for xml which translates (or serializes if you like) native datatypes into across languages. While xml is great for storing data, it does not map nicely to native data types. JSON fill's that need. In many ways it is similar to WDDX in that it serializes data. Just with half the bloat. http://jehiah.com/projects/cfjson/