Sunday, May 1, 2011

ColdFusion Query to java.sql.ResultSet

I've looked in the "undocumentation", and I can see how to create a coldfusion.sql.QueryTable from a ResultSet, but not the other way around. So, how can I extract the java.sql.ResultSet from a ColdFusion ( coldfusion.sql.QueryTable ) query object?

From stackoverflow
  • Turns out all I had to do was pass in my coldfusion.sql.QueryTable object...don't know why it works, unless ColdFusion is doing some sort of magic casting under the hood.

  • coldfusion.sql.QueryTable implements javax.sql.RowSet, which extends java.sql.ResultSet

    Thus, as you discovered, you don't need to do anything. A ColdFusion query is already a Java ResultSet.


Post a Comment