Java Reference
In-Depth Information
L ISTING 7.6
Continued
// Set the username
public void setUsername(String value) {
if ( value != null ) {
username = value;
}
}
// Get the username
public String getUserName() {
return username;
}
// Set the password
public void setPassword(String value) {
if ( value != null ) {
password = value;
}
}
// Get the password
public String getPassword() {
return password;
}
// Creates and returns a connection
private Connection createConnection() throws Exception {
Connection con = null;
// Create a Connection
con = DriverManager.getConnection(url,
username, password);
return con;
}
// Initialize the pool
public synchronized void initializePool() throws Exception {
Search WWH ::




Custom Search