|
Mailing Lists
|
Home /
Groups /
ColdFusion Talk (CF-Talk)
java recordset to ColdFusion recordset
I have created a class in java that returns a result setPhil Spitler 06/25/03 08:57 A Check this link out...Michael T. Tangorre 06/25/03 09:02 A ooops, sorry. If you have the class, im sure you know about this already.Michael T. Tangorre 06/25/03 09:06 A Okay, does anyone have a class that makes it easy to convert a ResultSetPhil Spitler 06/25/03 10:19 A Phil,Joe Eugene 06/25/03 10:51 A Does anyone know where I can get the cfusion.jar file, short ofPhil Spitler 06/25/03 11:27 A cfusion.jar is in your "CFusionMX\lib\cfusion.jar" directory,Joe Eugene 06/25/03 11:35 A The mm cfx.ar file contains a query interface, you'll need to convertCraig Dudley 06/25/03 09:08 A wont some of this stuff already be in MX? under the hood I mean?Robertson-Ravo, Neil (RX) 06/25/03 10:22 A maybe, but we're on cf5 :(Phil Spitler 06/25/03 10:26 A Phil,Craig Dudley 06/25/03 10:30 A ah......I am sure there must be an MX method you can use thoughRobertson-Ravo, Neil (RX) 06/25/03 10:32 A If your'e using cf5, it won't work anyway.Craig Dudley 06/25/03 11:31 A I have created a class in java that returns a result set (java.sql.ResultSet). I need to output that as a query in CF. I know some sort of conversion must take place in order to do this. Does anyone know of a java class out there that deals with this and where I can get it? I've been searching on google and can't come up with anything. THANKS! -- Phil Spitler [Applications Developer] American City Business Journals p: 704.973.1049 f: 704.973.8049 e: pspitler@amcity.com Check this link out... http://java.sun.com/j2se/1.4.1/docs/api/ > I have created a class in java that returns a result set > (java.sql.ResultSet). I need to output that as a query in CF. I know > some sort of conversion must take place in order to do this. Does > anyone know of a java class out there that deals with this and where I > can get it? I've been searching on google and can't come up with anything. ----- Excess quoted text cut - see Original Post for more ----- ooops, sorry. If you have the class, im sure you know about this already. LOL ----- Excess quoted text cut - see Original Post for more ----- 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: pspitler@amcity.com Phil, Instead of returing the Java Resultset which is a true ResultSet, you have to Convert resultSet to ColdFusion QueryTable() You will need the cfusion.jar file.. when you compile your code.. Results rs.. whatever.. QueryTable qt = new QueryTable(rs); return qt; I am pretty sure.. the class is QueryTable.. double check that. Hope this helps Joe Eugene ----- Excess quoted text cut - see Original Post for more ----- Does anyone know where I can get the cfusion.jar file, short of installing ColdFusion MX? We actually have it here, but it isn't installed. I don't want to go through that just to get this working. So, anyone know where I can get it? Phil Joe Eugene wrote: ----- Excess quoted text cut - see Original Post for more ----- cfusion.jar is in your "CFusionMX\lib\cfusion.jar" directory, Or just do a Search For CFusion.jar in your install directory. you will need to add this to your classPath Settings to compile your JavaBean/Java File. Joe Eugene ----- Excess quoted text cut - see Original Post for more ----- have ----- Excess quoted text cut - see Original Post for more ----- The mm cfx.ar file contains a query interface, you'll need to convert your class into a cfx to use it though, but it's not hard. Then just iterate over the sql resultset and do somethgin like .... int row = query.addRow(); query.setData( int row, int column, String value ) ; The Java CFX guide in the cf docs is pretty good at explaining how to use the query interface. I have created a class in java that returns a result set (java.sql.ResultSet). I need to output that as a query in CF. I know some sort of conversion must take place in order to do this. Does anyone know of a java class out there that deals with this and where I can get it? I've been searching on google and can't come up with anything. THANKS! -- Phil Spitler [Applications Developer] American City Business Journals p: 704.973.1049 f: 704.973.8049 e: pspitler@amcity.com wont some of this stuff already be in MX? under the hood I mean? 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: pspitler@amcity.com maybe, but we're on cf5 :( Robertson-Ravo, Neil (RX) wrote: ----- Excess quoted text cut - see Original Post for more ----- -- Phil Spitler [Applications Developer] American City Business Journals p: 704.973.1049 f: 704.973.8049 e: pspitler@amcity.com 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. 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: pspitler@amcity.com ah......I am sure there must be an MX method you can use though maybe, but we're on cf5 :( Robertson-Ravo, Neil (RX) wrote: ----- Excess quoted text cut - see Original Post for more ----- -- Phil Spitler [Applications Developer] American City Business Journals p: 704.973.1049 f: 704.973.8049 e: pspitler@amcity.com If your'e using cf5, it won't work anyway. Does anyone know where I can get the cfusion.jar file, short of installing ColdFusion MX? We actually have it here, but it isn't installed. I don't want to go through that just to get this working. So, anyone know where I can get it? Phil Joe Eugene wrote: ----- Excess quoted text cut - see Original Post for more -----
|
May 20, 2013
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||