I don't know how to CONCLUSIVELY determine which version of the JDBC driver 
that a given instance of CFMX is using. I made up my own function (see below*), 
but I'm not completely sure it's trustworthy, because  of the surprising 
results I get.

Can somebody give me the authoritative way to determine the driver version IN 
USE?

Thanks,
Jamie

* Is this a valid way to get which version of the driver a given datasource is 
using? I made it up.
<cffunction name="getJDBCDriverInfo" output="false" returntype="struct"
 hint="returns a JDBC driver info">
  <cfargument name="dsn" type="string" required="yes">
  <cfargument name="catalog" type="string" required="yes"
   hint="catalog(name) is, for example, the 'db' name (according to MSSQL) or 
the 'schema' name (according to ORACLE)">
  <cfargument name="username" type="string" required="yes">
  <cfargument name="password" type="string" required="yes"> 
  <cfscript>
  // declare local variables
  var dss = "";
  var conn = "";
  var mdata = "";
  
  /* create a datasource service */
  // Create a service factory
  dss = CreateObject("java", "coldfusion.server.ServiceFactory");
  // get a datasource service
  dss = dss.getDataSourceService();
  
  /* configure connection */
  // set CF datasource name
  conn = dss.getDataSource(dsn);
  // set db login
  conn = conn.getConnection(username,password);
  
  // get metadata from connection
  mdata = conn.getMetaData();  

  // provide some info about the driver
  driverSct["MajorVersion"] = mdata.getDriverMajorVersion();
  driverSct["MinorVersion"] = mdata.getDriverMinorVersion();
  driverSct["DriverVersion"] = mdata.getDriverVersion();
  driverSct["Name"] = mdata.getDriverName();
  </cfscript>
  <!--- <cfdump var="#mdata#"> --->
  <!--- return the query of metadata --->
  <cfreturn driverSct>
  
</cffunction>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:237698
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to