String serverName = System.getProperty(DS_HOST_PROP_NAME);
// Only run this test if at least one of the above are set
if ((databaseName != null) || (serverName != null)
|| (userName != null) || (password != null) || (port != null)) {
MysqlConnectionPoolDataSource ds = new MysqlConnectionPoolDataSource();
if (databaseName != null) {
ds.setDatabaseName(databaseName);
}
if (userName != null) {
ds.setUser(userName);
}
if (password != null) {
ds.setPassword(password);
}
if (port != null) {
ds.setPortNumber(Integer.parseInt(port));
}
if (serverName != null) {
ds.setServerName(serverName);
}
bindDataSource(jndiName, ds);
ConnectionPoolDataSource boundDs = null;