House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

java recordset to ColdFusion recordset

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Check this link out...
Michael T. Tangorre
06/25/03 09:02 A
Phil,
Joe Eugene
06/25/03 10:51 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 though
Robertson-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
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Phil Spitler
06/25/2003 08:57 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Michael T. Tangorre
06/25/2003 09:02 AM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Michael T. Tangorre
06/25/2003 09:06 AM

ooops, sorry. If you have the class, im sure you know about this already. LOL ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Phil Spitler
06/25/2003 10:19 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Joe Eugene
06/25/2003 10:51 AM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Phil Spitler
06/25/2003 11:27 AM

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 -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Joe Eugene
06/25/2003 11:35 AM

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 -----

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Craig Dudley
06/25/2003 09:08 AM

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

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Robertson-Ravo, Neil (RX)
06/25/2003 10:22 AM

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

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Phil Spitler
06/25/2003 10:26 AM

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

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Craig Dudley
06/25/2003 10:30 AM

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

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Robertson-Ravo, Neil (RX)
06/25/2003 10:32 AM

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

Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Craig Dudley
06/25/2003 11:31 AM

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 -----


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 20, 2013

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
       1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31   

Designer, Developer and mobile workflow conference