Note: This blog post is from 2006. Some content may be outdated--though not necessarily. Same with links and subsequent comments from myself or others. Corrections are welcome, in the comments. And I may revise the content as necessary.Following onto my 2 previous entries related to updating JDBC drivers in CFMX 6 and 7, some readers may appreciate a little more help on the matter of determining just what version of the drivers they do now have installed.
This news has been shared in various blog entries over the past couple of years. I'd like to reprise them here for your edification. (Note that while they may show how to look at some particular driver, like SQL Server, you can--and would need--to change what they show to look at whichever driver you are interested in. More on that below.):
- Pete Freitag showed some CFML code that gives you the answer on screen
- Brandon Purcell showed a CFML approach that writes its output instead to the CF log files instead (see below for more)
- Steven Erat did a post that is a take-off on Brandon's approach. He too writes his result to the logs, but he shows code naming several different driver class names and showing their versions (at least as they were known then, in 2005). That list of classnames may still be useful in later years. See below. [Indeed, as an update, in 2008, Dan Switzer did another take on that hard-coded listing of driver names, and comments in 2013 showed it working for CF10 then.]
- Finally, Sarge showed how to get the info via the command line (again, see below for more on this, and see also my last comment in the comments section below the post, for a related tip on running that java command)
So a couple more thoughts on all this.
And about the last two options above
First, in the case of the second two options above, note two things:
- Those last two links are versions of each page as recovered using the good 'ol internet archive/wayback machine. For more on the value of this wonderful tool, see my post on that.
- Note that those last two links make reference to files or folders under C:\CFusionMX\ or C:\CFusionMX7\ folders, reflecting the time they were written. For those on CF10 and above, you would look now instead under [yourcf]\cfusion\, or if using instances, [yourcf]\[yourinstance]\.
Finding the version of the driver YOU are using
Second, I said above that you would need to use the name of the driver you really mean to look at, which may be different than what their example show. For instance, Pete's code shows looking at the SQL Server driver, macromedia.jdbc.sqlserver.SQLServerDriver. So what if you're using the Adobe-provided Oracle driver? Or any other?
Well, some good news if you use an "other" driver type (where you choose that in the CF Admin DSN page), then you must provide the driver classname yourself. That would be the name to use.
But what if you one of the several other kinds of drivers listed on that page? CF doesn't show you the classnames it uses for that. (And I could not find it in several places I looked. More below.)
But again see Steven Erat's code above that listed several of the class names known at the time (and which still seem fairly accurate more recently).
And while there are still other places that clever readers may want to point out that may hold them, I could not find them in these places:
- The DSN classname is not listed in the CF Admin page where you add/edit a DSN
- The DSN classname is not not listed in the CF Admin "settings summary" page, even though that does offer useful additional info, like the underlying jdbc URL that CF builds, when using its built-in DB drivers
- They classname is also not listed in the XML within the neo-datasources.xml or neo-drivers.xml files, if you know about them. There ARE classnames there, but you will see that if you look, for instance, at the SQLServer one, it does show a classname (in the "class" xml element). But it's just macromedia.jdbc.MacromediaDriver, not the macromedia.jdbc.sqlserver.SQLServerDriver used in the examples above.
- They're also not listed in the "system information" page in the CF admin--the "i" icon in the top right--which shows the "CF Server Java Class Path". That does not list the class names for the Adobe-provided DB drivers, because they are instead all embedded in one jar, called macromedia_drivers.jar. Really determined folks may know you can unzip that and dig around and determine class names and paths, but I won't elaborate that here.
So it seems that for the built-in CF-provided drivers, you're best off just using the variations offered in those examples above (especially Steven's).
Hope all that help others as much as they have me over the years.
For more content like this:
Need more help with problems?
- Signup to get my blog posts by email:
- Follow my blog RSS feed
- View the rest of my blog posts
- View my blog posts on the Adobe CF portal
- If you may prefer direct help, rather than digging around here/elsewhere or via comments, I can help via my consulting services
- See that for more on how I can help a) over the web, safely and securely, b) usually very quickly, c) teaching you as we go, and d) with satisfaction guaranteed