boolean isDataSource = false;
String dataSourceName = prop.getProperty(DatabaseConnectionContext.KEY_DATASOURCENAME);
String url = prop.getProperty(DatabaseConnectionContext.KEY_URL);
if (dataSourceName != null && !dataSourceName.equals("")) {
if (url != null && !url.equals(""))
throw new CreateConnectionFailureException("Failed to detect whether " +
"the connection properties is for Jdbc connection or for datasource connection: url=" + url +
" datasource=" + dataSourceName);
isDataSource = true;
}
else {
if (url == null || url.equals(""))
throw new CreateConnectionFailureException("Failed to detect whether " +
"the connection properties is for Jdbc connection or for datasource connection: " +
"both url and dataSourceName are either null or empty.");
}
return isDataSource;