final JdbcConnectionDefinition connectionDefinition =
(JdbcConnectionDefinition) getDialogModel().getConnections().getSelectedItem();
final OlapConnectionProvider connectionProvider;
if (connectionDefinition instanceof JndiConnectionDefinition)
{
final JndiConnectionDefinition jcd = (JndiConnectionDefinition) connectionDefinition;
final JndiConnectionProvider provider = new JndiConnectionProvider();
provider.setConnectionPath(jcd.getJndiName());
provider.setUsername(jcd.getUsername());
provider.setPassword(jcd.getPassword());
connectionProvider = provider;
}
else if (connectionDefinition instanceof DriverConnectionDefinition)
{
final DriverConnectionDefinition dcd = (DriverConnectionDefinition) connectionDefinition;