# This patch file was generated by NetBeans IDE # Following Index: paths are relative to: D:\EgretFiles\D\JDevelop\Projects\nb.org\main-golden # 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/src/org/netbeans/api/db/explorer/DatabaseConnection.java --- db/src/org/netbeans/api/db/explorer/DatabaseConnection.java Base (BASE) +++ db/src/org/netbeans/api/db/explorer/DatabaseConnection.java Locally Modified (Based On LOCAL) @@ -109,7 +109,8 @@ } /** - * Creates a new DatabaseConnection instance. + * Creates a new DatabaseConnection instance w/ a default display name based + * on connection URL and user * * @param driver the JDBC driver the new connection uses; cannot be null. * @param databaseURL the URL of the database to connect to; cannot be null. @@ -124,6 +125,27 @@ */ public static DatabaseConnection create(JDBCDriver driver, String databaseURL, String user, String schema, String password, boolean rememberPassword) { + return create(driver,databaseURL,user,schema,password,rememberPassword,null); + } + + /** + * Creates a new DatabaseConnection instance. + * + * @param driver the JDBC driver the new connection uses; cannot be null. + * @param databaseURL the URL of the database to connect to; cannot be null. + * @param user the username. + * @param schema the schema to use, or null for the default schema + * @param password the password. + * @param rememberPassword whether to remember the password for the current session. + * @param displayName the display name of the connection as it shows under the Databases node + * + * @return the new instance. + * + * @throws NullPointerException if driver or database are null. + */ + public static DatabaseConnection create(JDBCDriver driver, String databaseURL, + String user, String schema, String password, boolean rememberPassword, + String displayName) { if (driver == null || databaseURL == null) { throw new NullPointerException(); } @@ -135,7 +157,7 @@ conn.setSchema(schema); conn.setPassword(password); conn.setRememberPassword(rememberPassword); - + conn.setDisplayName(displayName); return conn.getDatabaseConnection(); }