if (dSource instanceof JNDIDataSourceEntry && getType().equals(CUSTOM_TYPE)) {
setJndiStatusError();
} else if (dSource instanceof JDBCDataSourceEntry && getType().equals(JNDI_TYPE)) {
setJdbcStatusError();
} else if (dSource instanceof JNDIDataSourceEntry && getType().equals(JNDI_TYPE)) {
JNDIDataSourceEntry jndiDS = (JNDIDataSourceEntry) dSource;
fillValues(jndiDS);
jndiDS.save();
} else if (dSource instanceof JDBCDataSourceEntry && getType().equals(CUSTOM_TYPE)) {
JDBCDataSourceEntry polyDS = (JDBCDataSourceEntry) dSource;
fillValues(polyDS);
if(polyDS.getPassword()==null ||
(passwordChanged!=null && "true".equals(passwordChanged))||
!PARAM_DEFAULT_PASS_VALUE.equals(getPassword())){
polyDS.setPassword(getPassword());
}
polyDS.save();
}
}
}
// Create a DataSource
else {
if (getType().equals(JNDI_TYPE)) {
JNDIDataSourceEntry jndiDS = new JNDIDataSourceEntry();
fillValues(jndiDS);
jndiDS.save();
} else if (getType().equals(CUSTOM_TYPE)) {
JDBCDataSourceEntry polyDS = new JDBCDataSourceEntry();
fillValues(polyDS);
polyDS.setPassword(getPassword());