Package org.apache.torque.dsfactory

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();
                    Configuration subConf = c.subset(handle);
                    dsf.initialize(subConf);

                    Database database = getOrCreateDatabase(handle);
                    database.setDataSourceFactory(dsf);

                    // deprecated method of schema configuration
View Full Code Here


                    continue;
                }

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

            throw new TorqueException("Torque is not initialized");
        }

        Database database = getDatabase(name);

        DataSourceFactory dsf = null;
        if (database != null)
        {
            dsf = database.getDataSourceFactory();
        }
View Full Code Here

     * <code>DEFAULT_NAME</code> is defined. (TRQS 322)
     * @throws Exception if an error occurs during the Test.
     */
    public void testDefaultDataSourceFactory() throws Exception
    {
        DataSourceFactory defaultDataSourceFactory
                = Torque.getInstance().getDataSourceFactory(DEFAULT_NAME);
        assertNotNull(
                "The DataSourceFactory for Key "
                + DEFAULT_NAME
                + " should not be null",
                defaultDataSourceFactory);
        DataSourceFactory postgresqlDataSourceFactory
                = Torque.getInstance().getDataSourceFactory(POSTGRESQL_NAME);
        assertSame("The default DataSourceFactory "
                + "and the postgresql DataSourceFactory "
                + "are not the same object",
                defaultDataSourceFactory,
View Full Code Here

                    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

                    break;
                }

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

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

        DataSourceFactory dsf = null;
        if (database != null)
        {
            dsf = database.getDataSourceFactory();
        }
View Full Code Here

     * @return the database schema for this database, or null if no schema
     *         has been set.
     */
    public String getSchema()
    {
        DataSourceFactory dsf = getDataSourceFactory();
        if (dsf == null)
        {
            return null;
        }
        return dsf.getSchema();
    }
View Full Code Here

     * <code>DEFAULT_NAME</code> is defined. (TRQS 322)
     * @throws Exception if an error occurs during the Test.
     */
    public void testDefaultDataSourceFactory() throws Exception
    {
        DataSourceFactory defaultDataSourceFactory
                = Torque.getInstance().getDataSourceFactory(DEFAULT_NAME);
        assertNotNull(
                "The DataSourceFactory for Key "
                + DEFAULT_NAME
                + " should not be null",
                defaultDataSourceFactory);
        DataSourceFactory turbineDataSourceFactory
                = Torque.getInstance().getDataSourceFactory(DEFAULT_NAME);
        assertSame("The default DataSourceFactory "
                + "and the turbine DataSourceFactory "
                + "are not the same object",
                defaultDataSourceFactory,
View Full Code Here

                    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

TOP

Related Classes of org.apache.torque.dsfactory.DataSourceFactory

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.