Barry, if I'm understanding your question correctly, have you looked at the
JSTL (JSP Standard Tag Library)? It makes JSP look a lot more like CFML,
particularly a query:

<sql:query var="deejays">
  SELECT * FROM mytable
</sql:query>

<%-- Get the column names for the header of the table --%>
<c:forEach var="columnName" items="${deejays.columnNames}">
  <th><c:out value="${columnName}"/></th>
</c:forEach>

<%-- Get the value of each column while iterating over rows --%>
<c:forEach var="row" items="${deejays.rows}">
  <tr>
    <c:forEach var="column" items="${row}">
      <td><c:out value="${column.value}"/></td>
    </c:forEach>
  </tr>
</c:forEach>

The JSTL has been included in JSP 2.0, which has been out for a couple years
now (and I think it grew out of work that the Jrun team did, being familiar
as they were with CFML). It's now available on all the J2EE and Servlet
Engine implementations  

For more, see:

http://www.devx.com/webdev/Article/16973/1763/page/3 

http://www.oracle.com/technology/sample_code/tech/java/codesnippet/jsps/jstl
sql.html

And many other resources.

/charlie

-----Original Message-----
From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf
Of Barry Beattie
Sent: Thursday, June 15, 2006 1:41 AM
To: cfaussie@googlegroups.com
Subject: [cfaussie] in praise of ColdFusion (and an OT Java question)


<snip>

anyhoo, I'm looking for a java replacement of the humble CFQUERY - but not
the database connectivity side of it.

perhaps a class than can

- be an object masquarading as a 2D data structure that can be dynamically
resized (ie: no db required) and has a simple API to do so (as easy as
QueryAddRow, QuerySetCell, QueryAddColumn)

- be accessed/iterated over with obj["keyname"][row] or obj[i][j]

- have simple SQL thrown against it.

Microsoft's ADO.NET can (mostly) do this (albeit with 10 times more code
than CF) http://msdn2.microsoft.com/en-us/system.data.datatable.aspx

but is there a java version of the same? Surely someone has already done
this (apart from Alaire/Macromedia/Adobe)


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"cfaussie" group.
To post to this group, send email to cfaussie@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cfaussie
-~----------~----~----~----~------~----~------~--~---

Reply via email to