Package it.eng.qbe.datasource

Examples of it.eng.qbe.datasource.ConnectionDescriptor


     

      String sqlQuery = statement.getSqlQueryString();
      UserProfile userProfile = (UserProfile)getEnv().get(EngineConstants.ENV_USER_PROFILE);
     
      ConnectionDescriptor connection = (ConnectionDescriptor)getDataSource().getConfiguration().loadDataSourceProperties().get("connection");
      DataSource dataSource = getDataSource(connection);
     
      String sqlStatement = buildSqlStatement(crosstabDefinition, query, sqlQuery, statement);
      logger.debug("Querying temporary table: user [" + userProfile.getUserId() + "] (SQL): [" + sqlStatement + "]");
     
View Full Code Here


   
       
    it.eng.spagobi.tools.datasource.bo.IDataSource dataSrc = (it.eng.spagobi.tools.datasource.bo.IDataSource)env.get( EngineConstants.ENV_DATASOURCE );
    SpagoBiDataSource ds = dataSrc.toSpagoBiDataSource();
   
    ConnectionDescriptor connection = new ConnectionDescriptor();     
    connection.setName( ds.getLabel() );
    connection.setDialect( ds.getHibDialectClass() );     
    connection.setJndiName( ds.getJndiName() );     
    connection.setDriverClass( ds.getDriver() );     
    connection.setPassword( ds.getPassword() );
    connection.setUrl( ds.getUrl() );
    connection.setUsername( ds.getUser() );     
   
    Map<String, Object> dataSourceProperties = new HashMap<String, Object>();
    dataSourceProperties.put("connection", connection);
    dataSourceProperties.put("dblinkMap", template.getDbLinkMap());
   
View Full Code Here

      try {
        logger.debug("Executing query: [" + sqlQuery + "]");
        auditlogger.info("[" + userProfile.getUserId() + "]:: SQL: " + sqlQuery);
       
        dataSet = new JDBCDataSet();
        ConnectionDescriptor connection = (ConnectionDescriptor)getDataSource().getConfiguration().loadDataSourceProperties().get("connection");
        DataSource dataSource = new DataSource();
        dataSource.setJndi(connection.getJndiName());
        dataSource.setHibDialectName(connection.getDialect());
        dataSource.setUrlConnection(connection.getUrl());
        dataSource.setDriver(connection.getDriverClass());
        dataSource.setUser(connection.getUsername());
        dataSource.setPwd(connection.getPassword());
        dataSet.setDataSource(dataSource);
        dataSet.setQuery(sqlQuery);
        dataSet.loadData(start, limit, -1);
        dataStore = dataSet.getDataStore();
      } catch (Exception e) {
View Full Code Here

        logger.debug("Executing query: [" + sqlQuery + "]");
        auditlogger.info("[" + userProfile.getUserId() + "]:: SQL: " + sqlQuery);
       
        dataSet = new JDBCDataSet();
        //Session session = getDatamartModel().getDataSource().getSessionFactory().openSession();
        ConnectionDescriptor connection = (ConnectionDescriptor)getDataSource().getConfiguration().loadDataSourceProperties().get("connection");
        DataSource dataSource = new DataSource();
        dataSource.setJndi(connection.getJndiName());
        dataSource.setHibDialectName(connection.getDialect());
        dataSource.setUrlConnection(connection.getUrl());
        dataSource.setDriver(connection.getDriverClass());
        dataSource.setUser(connection.getUsername());
        dataSource.setPwd(connection.getPassword());
        dataSet.setDataSource(dataSource);
        dataSet.setQuery(sqlQuery);
        dataSet.loadData(start, limit, -1);
        dataStore = dataSet.getDataStore();
        IDataStoreMetaData dataStoreMetadata = dataStore.getMetaData();
View Full Code Here

    sf = cfg.buildSessionFactory();
    sessionFactoryMap.put(configuration.getModelName(), sf);   
  }
 
  private ConnectionDescriptor getConnection() {
    ConnectionDescriptor connection = (ConnectionDescriptor)configuration.loadDataSourceProperties().get("connection");
    return connection;
  }
View Full Code Here

  protected Configuration buildEmptyConfiguration() {
    Configuration cfg = null;
   
    cfg = new Configuration();
   
    ConnectionDescriptor connection = getConnection();
   
    if(connection.isJndiConncetion()) {
      cfg.setProperty("hibernate.connection.datasource", connection.getJndiName());
    } else {
      cfg.setProperty("hibernate.connection.url", connection.getUrl());
      cfg.setProperty("hibernate.connection.password", connection.getPassword());
      cfg.setProperty("hibernate.connection.username", connection.getUsername());
      cfg.setProperty("hibernate.connection.driver_class", connection.getDriverClass());
    }
       
    cfg.setProperty("hibernate.dialect", connection.getDialect());
   
    // Ingres does not support scrollable result set
    if ("org.hibernate.dialect.IngresDialect".equals(connection.getDialect())) {
      cfg.setProperty("hibernate.jdbc.use_scrollable_resultset", "false");
    }
   
    cfg.setProperty("hibernate.cglib.use_reflection_optimizer", "true");
    cfg.setProperty("hibernate.show_sql", "false");
View Full Code Here

        operandValueToBound = StringUtils.escapeQuotes(operandValueToBound);
        return StringUtils.bound(operandValueToBound, "'");
      }
    } else if(operandType.equalsIgnoreCase("TIMESTAMP") || operandType.equalsIgnoreCase("DATE") || operandType.equalsIgnoreCase("java.sql.TIMESTAMP") || operandType.equalsIgnoreCase("java.sql.date") || operandType.equalsIgnoreCase("java.util.date")){

      ConnectionDescriptor connection = (ConnectionDescriptor)getDataSource().getConfiguration().loadDataSourceProperties().get("connection");
      String dbDialect = connection.getDialect();
     
      String userDateFormatPattern = (String)getParameters().get("userDateFormatPattern");
      DateFormat userDataFormat = new SimpleDateFormat(userDateFormatPattern);   
      try{
        operandValueToBoundDate = userDataFormat.parse(operandValueToBound);
View Full Code Here

 
    /* (non-Javadoc)
   * @see it.eng.qbe.naming.NamingStrategy#getDatasourceName(java.util.List, it.eng.qbe.datasource.DBConnection)
   */
  public String getDataSourceName(IDataSourceConfiguration configuration) {
    ConnectionDescriptor connection = (ConnectionDescriptor)configuration.loadDataSourceProperties().get("connection");
    List<String> modelNames = new ArrayList<String>();
    if(configuration instanceof CompositeDataSourceConfiguration){
      CompositeDataSourceConfiguration cc = (CompositeDataSourceConfiguration)configuration;
      Iterator<IDataSourceConfiguration> it = cc.getSubConfigurations().iterator();
      while(it.hasNext()) modelNames.add(it.next().getModelName());
View Full Code Here

  public void close() {
    factory = null;
  }
 
  public ConnectionDescriptor getConnection() {
    ConnectionDescriptor connection = (ConnectionDescriptor)configuration.loadDataSourceProperties().get("connection");
    return connection;
  }
View Full Code Here

      
        String modelName = getDatamarts();
        List<String> modelNames = new ArrayList<String>();
        modelNames.add( modelName );
  
        ConnectionDescriptor connection = new ConnectionDescriptor();
        connection.setName( modelName );
        connection.setDialect( dataSource.getHibDialectClass() );          
        connection.setJndiName( dataSource.getJndi() );          
        connection.setDriverClass( dataSource.getDriver() );          
        connection.setPassword( dataSource.getPwd() );
        connection.setUrl( dataSource.getUrlConnection() );
        connection.setUsername( dataSource.getUser() );  

        dataSourceProperties.put("connection", connection);
        dataSourceProperties.put("dblinkMap", new HashMap());

      File modelJarFile = null;
View Full Code Here

TOP

Related Classes of it.eng.qbe.datasource.ConnectionDescriptor

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.