Package org.beangle.webapp.database.model

Examples of org.beangle.webapp.database.model.DatasourceBean


        List<?> datasources = entityDao.getAll(DatasourceBean.class);
        put("datasources", datasources);
        return forward();
      } else {
        DataSource datasource = datasourceService.getDatasource(datasourceId);
        DatasourceBean dsbean = entityDao.get(DatasourceBean.class, datasourceId);
        dsbean.getProvider().getDialect();
        ActionContext.getContext().getSession()
            .put("QueryContext", new QueryContext(datasource, dsbean));
        return redirect("index", "info.action.success");
      }
    }
View Full Code Here


    if (null == datasource) {
      OqlBuilder<DatasourceBean> builder = OqlBuilder.from(DatasourceBean.class, "ds");
      builder.where("ds.id=:id", id);
      List<DatasourceBean> beans = entityDao.search(builder);
      if (!beans.isEmpty()) {
        DatasourceBean bean = beans.get(0);
        DriverManagerDataSource ds = new DriverManagerDataSource();
        ds.setUrl(bean.getUrl());
        ds.setUsername(bean.getUsername());
        ds.setPassword(bean.getPassword());
        ds.setDriverClassName(bean.getDriverClassName());
        Properties properties = new Properties();
        for (DatasourcePropertyBean propertyBean : bean.getProperties()) {
          properties.put(propertyBean.getName(), propertyBean.getValue());
        }
        ds.setConnectionProperties(properties);
        datasource = ds;
      }
View Full Code Here

  }

  private void loadObjects() throws Exception {
    QueryContext queryConext = getQueryContext();
    DataSource datasource = queryConext.getDataSource();
    DatasourceBean dsbean = queryConext.getDatasourceBean();
    DatabaseMetaData meta = datasource.getConnection().getMetaData();
    List<String> schemas = CollectUtils.newArrayList();
    ResultSet rs = meta.getSchemas();
    while (rs.next()) {
      schemas.add(rs.getString(1));
    }
    MetadataLoader loader = new MetadataLoader((Dialect) Class.forName(dsbean.getProvider().getDialect())
        .newInstance(), meta);
    Set<Table> tables = CollectUtils.newHashSet();
    if (!schemas.isEmpty()) {
      String schema = get("schema");
      if (StringUtils.isNotEmpty(schema)) {
View Full Code Here

TOP

Related Classes of org.beangle.webapp.database.model.DatasourceBean

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.