Lines 27-33
Link Here
|
27 |
* Contributor(s): |
27 |
* Contributor(s): |
28 |
* |
28 |
* |
29 |
* The Original Software is NetBeans. The Initial Developer of the Original |
29 |
* The Original Software is NetBeans. The Initial Developer of the Original |
30 |
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2009 Sun |
30 |
* Software is Sun Microsystems, Inc. Portions Copyright 1997-2010 Sun |
31 |
* Microsystems, Inc. All Rights Reserved. |
31 |
* Microsystems, Inc. All Rights Reserved. |
32 |
* |
32 |
* |
33 |
* If you wish your version of this file to be governed by only the CDDL |
33 |
* If you wish your version of this file to be governed by only the CDDL |
Lines 87-92
Link Here
|
87 |
|
87 |
|
88 |
static { |
88 |
static { |
89 |
DatabaseConnectionAccessor.DEFAULT = new DatabaseConnectionAccessor() { |
89 |
DatabaseConnectionAccessor.DEFAULT = new DatabaseConnectionAccessor() { |
|
|
90 |
@Override |
90 |
public DatabaseConnection createDatabaseConnection(org.netbeans.modules.db.explorer.DatabaseConnection conn) { |
91 |
public DatabaseConnection createDatabaseConnection(org.netbeans.modules.db.explorer.DatabaseConnection conn) { |
91 |
return new DatabaseConnection(conn); |
92 |
return new DatabaseConnection(conn); |
92 |
} |
93 |
} |
Lines 109-115
Link Here
|
109 |
} |
110 |
} |
110 |
|
111 |
|
111 |
/** |
112 |
/** |
112 |
* Creates a new DatabaseConnection instance. |
113 |
* Creates a new DatabaseConnection instance w/ a default display name based |
|
|
114 |
* on connection URL and user |
113 |
* |
115 |
* |
114 |
* @param driver the JDBC driver the new connection uses; cannot be null. |
116 |
* @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. |
117 |
* @param databaseURL the URL of the database to connect to; cannot be null. |
Lines 124-129
Link Here
|
124 |
*/ |
126 |
*/ |
125 |
public static DatabaseConnection create(JDBCDriver driver, String databaseURL, |
127 |
public static DatabaseConnection create(JDBCDriver driver, String databaseURL, |
126 |
String user, String schema, String password, boolean rememberPassword) { |
128 |
String user, String schema, String password, boolean rememberPassword) { |
|
|
129 |
return create(driver, databaseURL, user, schema, password, rememberPassword, null); |
130 |
} |
131 |
|
132 |
/** |
133 |
* Creates a new DatabaseConnection instance. |
134 |
* |
135 |
* @param driver the JDBC driver the new connection uses; cannot be null. |
136 |
* @param databaseURL the URL of the database to connect to; cannot be null. |
137 |
* @param user the username. |
138 |
* @param schema the schema to use, or null for the default schema |
139 |
* @param password the password. |
140 |
* @param rememberPassword whether to remember the password for the current session. |
141 |
* @param displayName the display name of the connection as it shows under the Databases node |
142 |
* |
143 |
* @return the new instance. |
144 |
* |
145 |
* @throws NullPointerException if driver or database are null. |
146 |
*/ |
147 |
public static DatabaseConnection create(JDBCDriver driver, String databaseURL, |
148 |
String user, String schema, String password, boolean rememberPassword, |
149 |
String displayName) { |
127 |
if (driver == null || databaseURL == null) { |
150 |
if (driver == null || databaseURL == null) { |
128 |
throw new NullPointerException(); |
151 |
throw new NullPointerException(); |
129 |
} |
152 |
} |
Lines 135-141
Link Here
|
135 |
conn.setSchema(schema); |
158 |
conn.setSchema(schema); |
136 |
conn.setPassword(password); |
159 |
conn.setPassword(password); |
137 |
conn.setRememberPassword(rememberPassword); |
160 |
conn.setRememberPassword(rememberPassword); |
138 |
|
161 |
conn.setDisplayName(displayName); |
139 |
return conn.getDatabaseConnection(); |
162 |
return conn.getDatabaseConnection(); |
140 |
} |
163 |
} |
141 |
|
164 |
|