Examples of DataSourceFactory


Examples of org.apache.torque.dsfactory.DataSourceFactory

    public Connection getConnection(String name, String username,
            String password)
            throws TorqueException
    {
        Connection con = null;
        DataSourceFactory dsf = null;
        try
        {
            dsf = (DataSourceFactory) dsFactoryMap.get(name);
            con = dsf.getDataSource().getConnection(username, password);
        }
        catch (Exception e)
        {
            if (dsf == null && e instanceof NullPointerException)
            {
View Full Code Here

Examples of org.apache.torque.dsfactory.DataSourceFactory

                    break;
                }

                try
                {
                    DataSourceFactory dataSourceFactory
                            = database.getDataSourceFactory();
                    if (dataSourceFactory != null)
                    {
                        dataSourceFactory.close();
                        database.setDataSourceFactory(null);
                    }
                }
                catch (TorqueException e)
                {
View Full Code Here

Examples of org.apache.torque.dsfactory.DataSourceFactory

    public DataSourceFactory getDataSourceFactory(String name)
            throws TorqueException
    {
        Database database = getDatabase(name);

        DataSourceFactory dsf = null;
        if (database != null)
        {
            dsf = database.getDataSourceFactory();
        }
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));

                    Database database = getOrCreateDatabase(handle);
                    database.setDataSourceFactory(dsf);
                }
            }
View Full Code Here

Examples of org.g4studio.core.orm.xibatis.sqlmap.engine.datasource.DataSourceFactory

        Properties props = state.getDsProps();

        type = state.getConfig().getTypeHandlerFactory().resolveAlias(type);
        try {
          state.getConfig().getErrorContext().setMoreInfo("Check the data source type or class.");
          DataSourceFactory dsFactory = (DataSourceFactory) Resources.instantiate(type);
          state.getConfig().getErrorContext()
              .setMoreInfo("Check the data source properties or configuration.");
          dsFactory.initialize(props);
          state.setDataSource(dsFactory.getDataSource());
          state.getConfig().getErrorContext().setMoreInfo(null);
        } catch (Exception e) {
          if (e instanceof SqlMapException) {
            throw (SqlMapException) e;
          } else {
View Full Code Here

Examples of org.gdbms.engine.data.DataSourceFactory

import org.gdbms.engine.data.AlphanumericDataSource;
import org.gdbms.engine.data.DataSourceFactory;

public class DBFDriverTests extends TestCase {
  public void testOpen() throws Exception {
    DataSourceFactory dsf = new DataSourceFactory();
    DriverUtilities.copy(new File("src/test/resources/puntos.backup.dbf"), new File("src/test/resources/puntos.dbf"));
    AlphanumericDataSource ads = dsf.getAlphanumericDataSource(new File("src/test/resources/puntos.dbf"));
    ads.beginTrans();
    ads.setDouble(0, 0, 3);
    ads.commitTrans();
    ads.start();
    assertTrue(ads.getDouble(0, 0) == 3);
View Full Code Here

Examples of org.gdbms.engine.data.DataSourceFactory

        }
    }

    @Override
    protected void setUp() throws Exception {
        dsf = new DataSourceFactory();
        DriverManager dm = new DriverManager();
        dm.registerDriver("object", FailingObjectDriver.class);
        dm.registerDriver("writeFailingFile", WriteFailingFileDriver.class);
        dm.registerDriver("closeFailingFile", CloseFailingFileDriver.class);
        dm.registerDriver("copyFailingFile", CopyFailingFileDriver.class);
View Full Code Here

Examples of org.gdbms.engine.data.DataSourceFactory

    }
    return jButton1;
  }
 
  public static void main(String[] args) throws Exception {
      DataSourceFactory dsf = SetUp.setUp("/root/workspace/gdbms_drivers", new DataSourceFactory());
      final DataSource ds = dsf.getDataSource("persona");
      ds.start();
        final EditingFrame ef = new EditingFrame();
        ef.getEditingTable().setDataSource(ds);
        ef.getEditingTable().startEditing();
        ef.addWindowListener(new WindowAdapter () {
View Full Code Here

Examples of org.gdbms.engine.data.DataSourceFactory

*/
public abstract class DataSourceTestCase extends TestCase{

  protected DataSourceFactory ds;
  protected void setUp() throws Exception {
      ds = SetUp.setUp(".", new DataSourceFactory("/tmp"));
  }
View Full Code Here

Examples of org.gdbms.engine.data.DataSourceFactory

    dm.loadDrivers(new File("drivers"));

    dm.getLoadFailures();

    // Setup del factory de DataSources
    ds = new DataSourceFactory();
    ds.setDriverManager(dm);

    // Setup de las tablas
    ds.registerDataSource("persona",
        new FileSourceDefinition("persona.csv"));
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.