Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  package pt.webdetails.cda.connections.mondrian;
  
  
  import  org.apache.commons.logging.Log;
  import  org.apache.commons.logging.LogFactory;
  import  org.dom4j.Element;
 import  org.pentaho.platform.api.engine.IConnectionUserRoleMapper;
 import  org.pentaho.platform.engine.core.system.PentahoSessionHolder;
 import  org.pentaho.platform.engine.core.system.PentahoSystem;
 import  org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.DataSourceProvider;
 import  org.pentaho.reporting.engine.classic.extensions.datasources.mondrian.DriverDataSourceProvider;
Created by IntelliJ IDEA. User: pedro Date: Feb 2, 2010 Time: 5:09:18 PM
 
 public class JdbcConnection extends AbstractMondrianConnection
 {
 
   private static final Log logger = LogFactory.getLog(JdbcConnection.class);
   public static final String TYPE = "mondrianJdbc";
   private Element connection;
 
   public JdbcConnection(final Element connectionthrows InvalidConnectionException
   {
 
     super(connection);
     this. = connection;
   }
 
 
   public JdbcConnection()
   {
   }
 
 
   @Override
   protected void initializeConnection(final Element connectionthrows InvalidConnectionException
   {
 
      = new JdbcConnectionInfo(connection);
 
   }
 
 
   @Override
   public String getType()
   {
     return ;
   }
 
 
   @Override
   public DataSourceProvider getInitializedDataSourceProvider() throws InvalidConnectionException
   {
 
 
     .debug("Creating new jdbc connection");
 
     final DriverDataSourceProvider connectionProvider = new DriverDataSourceProvider();
     connectionProvider.setDriver(.getDriver());
     connectionProvider.setUrl(.getUrl());
 
     final Properties properties = .getProperties();
     final Enumeration<Objectkeys = properties.keys();
     while (keys.hasMoreElements())
     {
       final String key = (Stringkeys.nextElement();
       final String value = properties.getProperty(key);
       connectionProvider.setProperty(keyvalue);
     }
 
     return connectionProvider;
   }
 
 
   public synchronized JdbcConnectionInfo getConnectionInfo()
   {
     JdbcConnectionInfo ci = new JdbcConnectionInfo(this.);
     return ci;
   }
 
 
   public boolean equals(final Object o)
   {
     if (this == o)
     {
       return true;
     }
     if (o == null || getClass() != o.getClass())
    {
      return false;
    }
    final JdbcConnection that = (JdbcConnectiono;
    if ( != null ? !.equals(that.connectionInfo) : that.connectionInfo != null)
    {
      return false;
    }
    return true;
  }
  public int hashCode()
  {
    return  != null ? .hashCode() : 0;
  }
  {
    final ArrayList<PropertyDescriptorproperties = super.getProperties();
    return properties;
  }
New to GrepCode? Check out our FAQ X