Examples of DataSourceFactory


Examples of org.apache.ibatis.datasource.DataSourceFactory

      }
      for (XNode child : context.getChildren()) {
        String id = child.getStringAttribute("id");
        if (isSpecifiedEnvironment(id)) {
          TransactionFactory txFactory = transactionManagerElement(child.evalNode("transactionManager"));
          DataSourceFactory dsFactory = dataSourceElement(child.evalNode("dataSource"));
          Environment.Builder environmentBuilder = new Environment.Builder(id, txFactory, dsFactory.getDataSource());
          configuration.setEnvironment(environmentBuilder.build());
        }
      }
    }
  }
View Full Code Here

Examples of org.apache.ibatis.datasource.DataSourceFactory

  private DataSourceFactory dataSourceElement(XNode context) throws Exception {
    if (context != null) {
      String type = context.getStringAttribute("type");
      Properties props = context.getChildrenAsProperties();
      DataSourceFactory factory = (DataSourceFactory) resolveClass(type).newInstance();
      factory.setProperties(props);
      return factory;
    }
    throw new BuilderException("Environment declaration requires a DataSourceFactory.");
  }
View Full Code Here

Examples of org.apache.ibatis.datasource.DataSourceFactory

      }
      for (XNode child : context.getChildren()) {
        String id = child.getStringAttribute("id");
        if (isSpecifiedEnvironment(id)) {
          TransactionFactory txFactory = transactionManagerElement(child.evalNode("transactionManager"));
          DataSourceFactory dsFactory = dataSourceElement(child.evalNode("dataSource"));
          Environment.Builder environmentBuilder = new Environment.Builder(id, txFactory, dsFactory.getDataSource());
          configuration.setEnvironment(environmentBuilder.build());
        }
      }
    }
  }
View Full Code Here

Examples of org.apache.ibatis.datasource.DataSourceFactory

  private DataSourceFactory dataSourceElement(XNode context) throws Exception {
    if (context != null) {
      String type = context.getStringAttribute("type");
      Properties props = context.getChildrenAsProperties();
      DataSourceFactory factory = (DataSourceFactory) resolveClass(type).newInstance();
      factory.setProperties(props);
      return factory;
    }
    throw new BuilderException("Environment declaration requires a DataSourceFactory.");
  }
View Full Code Here

Examples of org.apache.torque.dsfactory.DataSourceFactory

                    String classname = c.getString(key);
                    String handle = key.substring(0, key.indexOf('.'));
                    log.debug("handle: " + handle
                            + " DataSourceFactory: " + classname);
                    Class dsfClass = Class.forName(classname);
                    DataSourceFactory dsf =
                            (DataSourceFactory) dsfClass.newInstance();
                    dsf.initialize(c.subset(handle));
                    dsFactoryMap.put(handle, dsf);
                }
            }
        }
        catch (Exception e)
View Full Code Here

Examples of org.apache.torque.dsfactory.DataSourceFactory

                // this leads to closing the same DataSourceFactory twice.
                it.remove();
                break;
            }

            DataSourceFactory dsf
                    = (DataSourceFactory) dsFactoryMap.get(dsfKey);
            try
            {
                dsf.close();
                it.remove();
            }
            catch (TorqueException e)
            {
                log.error("Error while closing the DataSourceFactory "
View Full Code Here

Examples of org.apache.torque.dsfactory.DataSourceFactory

     */
    public Connection getConnection(String name)
            throws TorqueException
    {
        Connection con = null;
        DataSourceFactory dsf = null;

        try
        {
            return getDataSourceFactory(name).getDataSource().getConnection();
        }
View Full Code Here

Examples of org.apache.torque.dsfactory.DataSourceFactory

      if (!isInit())
      {
            throw new TorqueException("Torque is not initialized.");
      }

      DataSourceFactory dsf = null;

        try
        {
            dsf = (DataSourceFactory) dsFactoryMap.get(name);
        }
View Full Code Here

Examples of org.apache.torque.dsfactory.DataSourceFactory

                        String classname = c.getString(key);
                        String handle = key.substring(0, key.indexOf('.'));
                        log.debug("handle: " + handle
                                + " DataSourceFactory: " + classname);
                        Class dsfClass = Class.forName(classname);
                        DataSourceFactory dsf =
                                (DataSourceFactory) dsfClass.newInstance();
                        dsf.initialize(c.subset(handle));
                        dsFactoryMap.put(handle, dsf);
                        foundFactories = true;
                    }
                }
                if (!foundFactories)
View Full Code Here

Examples of org.apache.torque.dsfactory.DataSourceFactory

     */
    public Connection getConnection(String name)
            throws TorqueException
    {
        Connection con = null;
        DataSourceFactory dsf = null;
        try
        {
            dsf = (DataSourceFactory) dsFactoryMap.get(name);
            con = dsf.getDataSource().getConnection();
        }
        catch (Exception e)
        {
            if (dsf == null && e instanceof NullPointerException)
            {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.