dcp.getProperty("::pentaho-reporting::port"),
p);
}
else if (provider instanceof JndiDataSourceProvider)
{
final JndiDataSourceProvider jcp = (JndiDataSourceProvider) provider;
final ListModel model = dialogModel.getConnections();
for (int i = 0; i < model.getSize(); i++)
{
final JdbcConnectionDefinition definition = (JdbcConnectionDefinition) model.getElementAt(i);
if (definition instanceof JndiConnectionDefinition == false)
{
continue;
}
final JndiConnectionDefinition dcd = (JndiConnectionDefinition) definition;
if (ObjectUtilities.equal(dcd.getJndiName(), jcp.getConnectionPath()))
{
return dcd;
}
}
return new JndiConnectionDefinition(customName, jcp.getConnectionPath(), null,
dataFactory.getJdbcUser(), dataFactory.getJdbcPassword());
}
return null;
}