Phil,
Here's an example..
import com.allaire.cfx.*;
// import your other classes
public class CFResultSet implements CustomTag{
public void processRequest( Request request, Response response )
throws Exception{
if (!request.attributeExists("queryname"))
{
throw new Exception("'queryname' is required.");
}
// get your SQL result set in here somewhere (assuming col1,col2
as column names)
String queryname = request.getAttribute("queryname");
String[] columns = { "col1", "col2"}; //
Query query = response.addQuery( queryname, columns );
// now loop over the result set (example code off the top of my
head)
for (int i = 0; i < resultset.length() ; i++)
int iRow = query.addRow() ;
query.setData( iRow, 1, col1value ) ;
query.setData( iRow, 2, col2Value ) ;
}
}
Without seeing what you have I cant get it any closer.
Regards.
Craig.
-----Original Message-----
From: Phil Spitler [mailto:[EMAIL PROTECTED]
Sent: 25 June 2003 15:14
To: CF-Talk
Subject: Re: java recordset to cf recordset
Okay, does anyone have a class that makes it easy to convert a ResultSet
to a Query? For example, something like:
public class CFResultSet implements java.sql.ResultSet,
com.allaire.cfx.Query {
public CFResultSet(ResultSet) {
}
...
}
--
Phil Spitler [Applications Developer]
American City Business Journals
p: 704.973.1049
f: 704.973.8049
e: [EMAIL PROTECTED]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at
http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4