Package org.apache.cayenne.conn

Examples of org.apache.cayenne.conn.DriverDataSource


        try {
            final DbAdapter adapterInst = (adapter == null) ? new JdbcAdapter()
                                                                : (DbAdapter) Class.forName(adapter).newInstance();

            // load driver taking custom CLASSPATH into account...
            DriverDataSource dataSource = new DriverDataSource((Driver) Class.forName(driver).newInstance(), url, username, password);

            // Load the data map and run the db importer.
            final LoaderDelegate loaderDelegate = new LoaderDelegate();
            final DbLoader loader = new DbLoader(dataSource.getConnection(), adapterInst, loaderDelegate);
            loader.setCreatingMeaningfulPK(meaningfulPk);

            if (namingStrategy != null) {
                final NamingStrategy namingStrategyInst = (NamingStrategy) Class.forName(namingStrategy).newInstance();
                loader.setNamingStrategy(namingStrategyInst);
View Full Code Here


            generator.setShouldCreateTables(createTables);
            generator.setShouldDropPKSupport(dropPK);
            generator.setShouldDropTables(dropTables);

            // load driver taking custom CLASSPATH into account...
            DriverDataSource dataSource = new DriverDataSource((Driver) Class.forName(
                    driver).newInstance(), url, userName, password);

            generator.runGenerator(dataSource);
        }
        catch (Exception ex) {
View Full Code Here

        validateAttributes();

        try {

            // load driver taking custom CLASSPATH into account...
            DriverDataSource dataSource = new DriverDataSource((Driver) Class.forName(driver).newInstance(), url, userName, password);

            // Load the data map and run the db importer.
            final LoaderDelegate loaderDelegate = new LoaderDelegate();
            final DbLoader loader = new DbLoader(dataSource.getConnection(), adapter, loaderDelegate);
            loader.setCreatingMeaningfulPK(meaningfulPk);

            if (namingStrategy != null) {
                final NamingStrategy namingStrategyInst = (NamingStrategy) Class.forName(namingStrategy).newInstance();
                loader.setNamingStrategy(namingStrategyInst);
View Full Code Here

            Class driverClass = getApplication().getClassLoadingService().loadClass(
                    currentDataSource.getJdbcDriver());
            Driver driver = (Driver) driverClass.newInstance();

            // connect via Cayenne DriverDataSource - it addresses some driver issues...
            Connection c = new DriverDataSource(
                    driver,
                    currentDataSource.getUrl(),
                    currentDataSource.getUserName(),
                    currentDataSource.getPassword()).getConnection();
            try {
View Full Code Here

        if (isEmpty(true)) {
            return;
        }

        Driver driver = (Driver) Class.forName(dsi.getJdbcDriver()).newInstance();
        DataSource dataSource = new DriverDataSource(driver, dsi.getDataSourceUrl(), dsi
                .getUserName(), dsi.getPassword());

        runGenerator(dataSource);
    }
View Full Code Here

        if (isEmpty(true)) {
            return;
        }

        Driver driver = (Driver) Class.forName(dsi.getJdbcDriver()).newInstance();
        DataSource dataSource = new DriverDataSource(driver, dsi.getDataSourceUrl(), dsi
                .getUserName(), dsi.getPassword());

        runGenerator(dataSource);
    }
View Full Code Here

                    Driver.class,
                    currentDataSource.getJdbcDriver());
            Driver driver = driverClass.newInstance();

            // connect via Cayenne DriverDataSource - it addresses some driver issues...
            Connection c = new DriverDataSource(
                    driver,
                    currentDataSource.getUrl(),
                    currentDataSource.getUserName(),
                    currentDataSource.getPassword()).getConnection();
            try {
View Full Code Here

            generator.setShouldCreateTables(createTables);
            generator.setShouldDropPKSupport(dropPK);
            generator.setShouldDropTables(dropTables);

            // load driver taking custom CLASSPATH into account...
            DriverDataSource dataSource = new DriverDataSource((Driver) Class.forName(
                    driver).newInstance(), url, userName, password);

            generator.runGenerator(dataSource);
        }
        catch (Exception ex) {
View Full Code Here

        validateAttributes();

        try {

            // load driver taking custom CLASSPATH into account...
            DriverDataSource dataSource = new DriverDataSource((Driver) Class.forName(
                    driver).newInstance(), url, userName, password);

            // Load the data map and run the db importer.
            final LoaderDelegate loaderDelegate = new LoaderDelegate();
            final DbLoader loader = new DbLoader(
                    dataSource.getConnection(),
                    adapter,
                    loaderDelegate);
            loader.setCreatingMeaningfulPK(meaningfulPk);

            if (namingStrategy != null) {
View Full Code Here

        catch (Throwable th) {
            th = Util.unwindException(th);
            throw new SQLException("Driver load error: " + th.getLocalizedMessage());
        }

        return new DriverDataSource(driver, getUrl(), getUserName(), getPassword());
    }
View Full Code Here

TOP

Related Classes of org.apache.cayenne.conn.DriverDataSource

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.