Using Coldfusion MX w/Mysql at jodohost

I would HATE to see what some of the more complex queries that I am building would look like in this method. Additionally, if you're going to use that many CFSet's, then you really should bundle them all in a CFScript.

I'm glad 2.4 will be coming out in the near future to let us create our own DSN's for CF!

danp5648 said:
You could that does not mean you should. Using datasources only
slows things down for all because all you are doing is going from java then fooling with c++ drivers then back to java again. Why not just stay inside
java and let java fool with the c++ MS drivers. Here is another example
of CFMX talking to access then back into CFMX land.

<cfset class = createObject("java", "java.lang.Class")>
<cfset class.forName("sun.jdbc.odbc.JdbcOdbcDriver")>
<cfset dm = createObject("java","java.sql.DriverManager")>
<cfset con = dm.getConnection("jdbc:eek:dbc:DRIVER={Microsoft Access Driver (*.mdb)};DBQ=c://reports.mdb")>
<cfset st = con.createStatement()>
<cfset sql_string = "SELECT UID from dailyreport where UID > 14000">
<cfset resultSet = st.executeQuery(sql_string)>
<cfset isZERO = CreateObject("java", "coldfusion.sql.QueryTable").init(resultSet)>

<cfoutput>#isZERO.recordcount#</cfoutput>

coldfusion.sql.QueryTable is the raw side fluffy CFQUERY

Sun did a good job with there only JDBC driver, so use it!
 
Back
Top