This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

View | Details | Raw Unified | Return to bug 192150
Collapse All | Expand All

(-)db/src/org/netbeans/api/db/explorer/DatabaseConnection.java (-2 / +24 lines)
Lines 109-115 Link Here
109
    }
109
    }
110
    
110
    
111
    /**
111
    /**
112
     * Creates a new DatabaseConnection instance. 
112
     * Creates a new DatabaseConnection instance w/ a default display name based
113
     * on connection URL and user
113
     * 
114
     * 
114
     * @param driver the JDBC driver the new connection uses; cannot be null.
115
     * @param driver the JDBC driver the new connection uses; cannot be null.
115
     * @param databaseURL the URL of the database to connect to; cannot be null.
116
     * @param databaseURL the URL of the database to connect to; cannot be null.
Lines 124-129 Link Here
124
     */
125
     */
125
    public static DatabaseConnection create(JDBCDriver driver, String databaseURL, 
126
    public static DatabaseConnection create(JDBCDriver driver, String databaseURL, 
126
            String user, String schema, String password, boolean rememberPassword) {
127
            String user, String schema, String password, boolean rememberPassword) {
128
            return create(driver,databaseURL,user,schema,password,rememberPassword,null);
129
    }
130
131
    /**
132
     * Creates a new DatabaseConnection instance.
133
     *
134
     * @param driver the JDBC driver the new connection uses; cannot be null.
135
     * @param databaseURL the URL of the database to connect to; cannot be null.
136
     * @param user the username.
137
     * @param schema the schema to use, or null for the default schema
138
     * @param password the password.
139
     * @param rememberPassword whether to remember the password for the current session.
140
     * @param displayName the display name of the connection as it shows under the Databases node
141
     *
142
     * @return the new instance.
143
     *
144
     * @throws NullPointerException if driver or database are null.
145
     */
146
    public static DatabaseConnection create(JDBCDriver driver, String databaseURL, 
147
            String user, String schema, String password, boolean rememberPassword,
148
            String displayName) {
127
        if (driver == null || databaseURL == null) {
149
        if (driver == null || databaseURL == null) {
128
            throw new NullPointerException();
150
            throw new NullPointerException();
129
        }
151
        }
Lines 135-141 Link Here
135
        conn.setSchema(schema);
157
        conn.setSchema(schema);
136
        conn.setPassword(password);
158
        conn.setPassword(password);
137
        conn.setRememberPassword(rememberPassword);
159
        conn.setRememberPassword(rememberPassword);
138
        
160
        conn.setDisplayName(displayName);
139
        return conn.getDatabaseConnection();
161
        return conn.getDatabaseConnection();
140
    }
162
    }
141
    
163
    

Return to bug 192150