# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: /home/matthias/NetBeansProjects/core-main # This patch can be applied using context Tools: Patch action on respective folder. # It uses platform neutral UTF-8 encoding and \n newlines. # Above lines and this line are ignored by the patching process. Index: db/libsrc/org/netbeans/lib/ddl/impl/DriverSpecification.java --- db/libsrc/org/netbeans/lib/ddl/impl/DriverSpecification.java Base (BASE) +++ db/libsrc/org/netbeans/lib/ddl/impl/DriverSpecification.java Locally Modified (Based On LOCAL) @@ -91,40 +91,83 @@ if (catalog == null || dmd == null) { this.catalog = catalog; return; - } else - catalog.trim(); + } else { + catalog = catalog.trim(); + } - ResultSet result; + ResultSet result = null; List list = new LinkedList(); try { result = dmd.getCatalogs(); - while (result.next()) - list.add(result.getString(1).trim()); + while (result.next()) { + String candidate = result.getString(1); + if(candidate != null) { + list.add(candidate.trim()); + } + } result.close(); } catch (SQLException exc) { Logger.getLogger("global").log(Level.INFO, null, exc); - -// this.catalog = catalog; this.catalog = null; //hack for IBM ODBC driver - result = null; return; + } finally { + try { + if(result != null) { + result.close(); } + } catch (Exception ex) {} + } - if (list.contains(catalog)) + if (list.contains(catalog)) { this.catalog = catalog; - else + } else { this.catalog = null; //hack for Sybase ODBC driver } + } public String getCatalog() { return catalog; } public void setSchema(String schema) { + if (schema == null || dmd == null) { this.schema = schema; + return; + } else { + schema = schema.trim(); } + ResultSet result = null; + List list = new LinkedList(); + + try { + result = dmd.getSchemas(); + while (result.next()) { + String candidate = result.getString(1); + if(candidate != null) { + list.add(candidate.trim()); + } + } + } catch (SQLException exc) { + Logger.getLogger("global").log(Level.INFO, null, exc); + this.schema = null; //hack for Access ODBC driver + return; + } finally { + try { + if(result != null) { + result.close(); + } + } catch (Exception ex) {} + } + + if (list.contains(schema)) { + this.schema = schema; + } else { + this.schema = null; //hack for Sybase ODBC driver + } + } + public String getSchema() { return schema; }