|
ColdFusion detection in Connector/J 5.1.2 beta: msg#00006db.mysql.java
Hello, I noticed that the latest Connector/J version auto-detects ColdFusion and does some configuration, which is great. The code for doing this in com.mysql.jdbc.Util.java isn't so great however: // // Detect the ColdFusion MX environment // // Unfortunately, no easy-to-discern classes are available // to our classloader to check... // String loadedFrom = stackTraceToString(new Throwable()); if (loadedFrom != null) { isColdFusion = loadedFrom.indexOf("coldfusion") != -1; } else { isColdFusion = false; } Might I suggest something like the following code? try { Class cf = Class.forName("coldfusion.Version"); isColdFusion = true; // Methods available are: // String getProductName() // String getMajor(); // String getMinor(); // String getServicePack(); Method getMajor = cf.getMethod("getMajor", new Class[] {} ); String version = (String) getMajor.invoke(null, null); if (Integer.getInteger(version).intValue() >= 8) { // We can turn back on the calls to isCaseSensitive() in CF System.setProperty("coldfusion.mysql.enableiscasesensitive", "true"); } } catch (Exception e) { // ignore, default is isColdFusion = false; } Also note that in the next major release of ColdFusion (8.0) which will be released very soon we have worked around the MySql problem of round tripping to the server when isCaseSensitive() is called by detecting a mysql ResultSet and not doing this. Using the new driver this isn't necessary and you can turn back on the behavior by defining a Java System property -Dcoldfusion.mysql.enableiscasesensitive=true In any case, thanks for adding this configuration optimization - this will make our mutual customers happy! I would be happy to answer any other ColdFusion specific questions the MySQL team might have - contact me at tjordahl at adobe.com. Thanks! -- Tom Jordahl Adobe ColdFusion Team -- MySQL Java Mailing List For list archives: http://lists.mysql.com/java To unsubscribe: http://lists.mysql.com/java?unsub=gcdmj-java@xxxxxxxxxxx |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | confirm unsubscribe to java@xxxxxxxxxxxxxxx, java-help |
|---|---|
| Next by Date: | applet: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure, AlexeySmirnov |
| Previous by Thread: | confirm unsubscribe to java@xxxxxxxxxxxxxxx, java-help |
| Next by Thread: | RE: ColdFusion detection in Connector/J 5.1.2 beta - ATTN Mysql team!, Tom Jordahl |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | Mail Home | sitemap | FAQ | advertise |