I'm guessing they used good ol' Java introspection. Check this out: <CFQUERY NAME="demoq" DATASOURCE="cfdocexamples"> select * from employees </CFQUERY>
<cfset methods = demoq.getclass().getmethods()> <Cfloop from="1" to="#arraylen(methods)#" index="i"> <Cfoutput>#methods[i].getname()#</CFOUTPUT><br> </CFLOOP> Of course that lists over 200 methods, and not all are interesting, but it includes the ones that site lists. You could do this with lots of interesting variables and objects in both CFMX and BD. :-) /charlie -----Original Message----- From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rod Higgins Sent: Thursday, June 15, 2006 10:14 AM To: cfaussie@googlegroups.com Subject: [cfaussie] Re: in praise of ColdFusion (and an OT Java question) http://www.activsoftware.com/mx/undocumentation/query.cfm Found this on google, interesting reading. I dont know where they got that java code from?? hth Rod ----- Original Message ----- From: "Barry Beattie" <[EMAIL PROTECTED]> To: <cfaussie@googlegroups.com> Sent: Thursday, June 15, 2006 11:55 PM Subject: [cfaussie] Re: in praise of ColdFusion (and an OT Java question) > > thankyou for your response, Charlie. > > sadly, the JSTL seems to satisfy only one criteria. easy iteration to > access the data. > > From my understanding and research, the JSTL query "object" can *only* > be populated by throwing it against a database, not dynamically filled > like an arrayList, linkList or a CF query using QueryAddRow() / > QuerySetCell() / QueryAddColumn(). > > then there's the ability to filter and return rows based on simple SQL > syntax, which ADO.NET just manages to do** but CF's QueryOfQueries > does in style. > > unless I can find otherwise, the humble CFQUERY seems to be unique in > the way it looks like a collection/structure/datatype but has it's own > properties and methods to work with the data it holds. Thanks to a > simple API, it's much more than just the hashMap that's used under the > covers. > > as a side note re JSTL connecting to a database and returning results: > maybe it's just me but that idea (tight coupling between model and > view) just seems to be so.... 1998.... > > thanx anyhoo, Charlie. > > **internal storage of ADO.NET's datasets and datatables is (IIRC) XML > and all the methods do is query (XPath?) the xml or append nodes, etc. > While this is a possible solution, it's the sort of thing that you'd > wish someone else had written! > > (PS: Dale: Amen to that - but I am only a small voice in the crowd) > > > On 6/15/06, Charlie Arehart <[EMAIL PROTECTED]> wrote: >> >> 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 -~----------~----~----~----~------~----~------~--~---