Nick

Thanks for getting me started.

I found a few good references online at:

        <http://www.oreilly.com/info/java/printqref11/print.java.sql.html>
        <http://www.oreilly.com/catalog/jentnut2/chapter/ch02.html>

The latter included some good examples including the code below, which 
is the
beginning of what I want to.

With prior CFs running on MS you could count on being able to use ADO 
objects
through <cfobject>

The question is: how do I do this from within a CFMX  (on Linux) program?

I looked in the CF Docs, but they are pretty thin.

The following is the Java example, found at O'Reilly, followed by what 
should be
the equivalent CFMX code (as best as I could determine).

Using the Sun jdbcodbc driver -- it can't find the driver.

Using the pointbase driver, the Object gets created OK, but it can't 
find the DriverManager method.



Any help will be greatly appreciated.

<!---

final static String jdbcDriver = "sun.jdbc.odbc.JdbcOdbcDriver";

Class.forName(jdbcDriver);
Connection con = DriverManager.getConnection("url", "user", "password");
Statement stmt = con.createStatement(  );
ResultSet rs = stmt.executeQuery("SELECT * FROM CUSTOMERS");

ResultSetMetaData rsmd = rs.getMetaData(  );
int columnCount = rsmd.getColumnCount(  );
for(int col = 1; col <= columnCount; col++) {
   System.out.print(rsmd.getColumnLabel(col));
   System.out.print(" (" + rsmd.getColumnTypeName(col)+")");
   if(col < columnCount)
     System.out.print(", ");
}

--->

<cfobject
   action = "create"
   type = "java"
   class = "com.pointbase.jdbc.jdbcUniversalDriver"
   name = "myjdbc">

<cfscript>
con  = 
myjdbc.DriverManager.getConnection("jdbc:pointbase:cfsnippets,database.home=
/opt/coldfusionmx/db", "PBPUBLIC", "");
stmt = myjdbc.con.createStatement(  );
rs   = myjdbc.stmt.executeQuery("SELECT * FROM EMPLOYEES");
rsmd = myjdbc.rs.getMetaData(  );
</cfscript>



On Saturday, August 3, 2002, at 06:29 AM, Nick de Voil wrote:

> Dick
>
>> On non-Windows platforms, you couldn't use ADO anyway. I imagine that
> you
>> could use the appropriate JDBC driver to do some of this stuff, 
>> directly
>> from Java, but don't know enough about either Java or JDBC to say for
> sure.
>
> Dave's right, you can this with JDBC. Check out in particular
> java.sql.DatabaseMetaData and java.sql.ResultSetMetaData.
>
> Nick
>
> 
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more 
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to