--- ../../nb.orig/db/src/org/netbeans/api/db/sql/support/SQLIdentifiers.java 2011-03-07 00:30:06.000000000 +0100 +++ src/org/netbeans/api/db/sql/support/SQLIdentifiers.java 2011-03-12 22:12:36.000000000 +0100 @@ -179,6 +179,27 @@ caseRule = getCaseRule(dbmd); } + /** + * Report whether the driver reports correct quoting information + * + * At least the informix driver does not follow the api documentation about + * the method of {@see DatabaseMetaData#getIdentifierQuoteString()}. + * Instead of returning a single space for the case where no quote + * character exists it returns the empty string. + * + * Other non-conformant drivers can be added when identified. + * + * @param dbmd + * @return true if driver reports correct quoting character + * @throws SQLException + */ + protected static boolean emptyQuoteCharCorrect(DatabaseMetaData dbmd) throws SQLException { + if( dbmd.getDriverName().equals("IBM Informix JDBC Driver for IBM Informix Dynamic Server")) { //NOI18N + return true; + } + return false; + } + public final String quoteIfNeeded(String identifier) { Parameters.notNull("identifier", identifier); @@ -317,7 +338,7 @@ try { quoteStr = dbmd.getIdentifierQuoteString().trim(); // avoid empty quoteStr; if makes endless CC - if (quoteStr.length() == 0) { + if (quoteStr.length() == 0 && (! emptyQuoteCharCorrect(dbmd))) { quoteStr = "\""; // NOI18N } } catch ( SQLException e ) {