I'm using a Java object to return a query back to ColdFusion. The
problem is, it's not being recognized as a true CF Query, and it's
giving me errors. What's interesting is that if I cast the ResultSet to
a QueryTable in ColdFusion, it works, but if I return a QueryTable
directly from Java, it fails.
Here's what I mean:
// In my pojo:
public ResultSet getQuery ( String query )
{
// execute query here, returns a ResultSet
}
public QueryTable getCFQuery( String query )
{
// Convert the ResultSet to a QueryTable
return new QueryTable( getQuery( query ) );
}
// In ColdFusion:
<cfset pojo = CreatObject( "java", "path.to.my.Pojo" ) />
<cfset query = pojo.getCFQuery() />
At this point, IsQuery( query ) returns "NO", but if I cfdump it I can
see it's of type coldfusion.sql.QueryTable.
So, changing the ColdFusion code to return the result set from Java and
cast as a QueryTable directly:
<cfset pojo = CreatObject( "java", "path.to.my.Pojo" ) />
<cfset query = CreateObject("java",
"coldfusion.sql.QueryTable").init( pojo.getQuery() ) />
Then IsQuery( query ) returns "YES" and I have back a normal CF Query.
Does anyone else think this is odd? I want to return a CF Query
directly from my Pojo without having to create the QueryTable in the
ColdFusion code. Why does creating the QueryTable in the Pojo fail,
even though it returns the correct data type. Am I missing something
here, or is this a bug?
Thanks,
-d
You are subscribed to cfcdev. To unsubscribe, please follow the instructions at
http://www.cfczone.org/listserv.cfm
CFCDev is supported by:
Katapult Media, Inc.
We are cool code geeks looking for fun projects to rock!
www.katapultmedia.com
An archive of the CFCDev list is available at
www.mail-archive.com/[email protected]