Examples of DriverDescriptor


Examples of org.jitterbit.integration.database.driver.DriverDescriptor

    }

    private boolean isManualSqlStatementSupported(Locatable database) {
        if (database instanceof Source) {
            DatabaseLocation loc = (DatabaseLocation) database.getLocation();
            DriverDescriptor driver = loc.getDriver();
            if (driver != null) {
                return driver.isManualSqlStatementSupported();
            }
        }
        return false;
    }
View Full Code Here

Examples of org.jitterbit.integration.database.driver.DriverDescriptor

    }

    public void setDbLocation(DatabaseLocation dbLoc) {
        boolean supported = true;
        if (dbLoc != null) {
            DriverDescriptor driver = dbLoc.getDriver();
            supported = (driver != null) && driver.isManualSqlStatementSupported();
        }
        writeSQL.setEnabled(supported);
        jdbcOnlyLabel.setVisible(!supported);
    }
View Full Code Here

Examples of org.jitterbit.integration.database.driver.DriverDescriptor

        String beginQuote = loc.getProperty(DatabaseLocation.DRIVER_BEGIN_QUOTE);
        String endQuote = loc.getProperty(DatabaseLocation.DRIVER_END_QUOTE);
        BeginEndQuote quotes = (beginQuote != null && endQuote != null)
                ? new BeginEndQuote(beginQuote, endQuote) : null;
        String driverClass = loc.getProperty(DatabaseLocation.DRIVER_CLASS_PROPERTY);
        DriverDescriptor driver =  null;
        if (StringUtils.isEmpty(driverClass)) {
            driver = OdbcDriverDescriptorFactory.createDescriptor(name, quotes);
        }
        else {
            String subprotocol = loc.getProperty(DatabaseLocation.JDBC_SUBPROTOCOL);
View Full Code Here

Examples of org.jitterbit.integration.database.driver.DriverDescriptor

            provider.getTableInfo(connectionParams, sourceId, null, objects, callback);
        }
    }

    private boolean isSupportedLocation() {
        DriverDescriptor driver = connectionParams.getDriver();
        boolean supported = driver != null && driver.isManualSqlStatementSupported();
        if (!supported) {
            String message = "Manual SQL statements are not supported for the selected database. Have you "
                            + "just changed its driver?";
            callback.caught(new Exception(message));
        }
View Full Code Here

Examples of org.jitterbit.integration.database.driver.DriverDescriptor

        }
        return connectionString;
    }

    private String getConnectionStringFromDriver() {
        DriverDescriptor driver = getDriver();
        if (driver != null) {
            ConnectionParams params = getConnectionParams();
            StringBuilder sb = new StringBuilder(driver.getConnectionString(params));
            appendOptionalParameters(sb);
            return sb.toString();
        }
        return null;
    }
View Full Code Here

Examples of org.jitterbit.integration.database.driver.DriverDescriptor

     *
     * @param driver
     *            a <code>DriverDescriptor</code> representing the database driver.
     */
    public void setDriver(DriverDescriptor driver) {
        DriverDescriptor old;
        BeginEndQuote oldQuotes;
        BeginEndQuote newQuotes;
        synchronized (getDataLock()) {
            old = getDriver();
            oldQuotes = getDriverBeginEndQuote();
View Full Code Here

Examples of org.jitterbit.integration.database.driver.DriverDescriptor

        loc = new DatabaseLocation();
    }

    @Test
    public void ensureGetAndSetDriverWorks() {
        DriverDescriptor driver = new JdbcDriverDescriptor("PostgreSQL", "postgresql", "org.postgres.Driver",
                        BeginEndQuote.fromStrings("\"", "\""));
        TestDataUtils.testGetterAndSetter(loc, DatabaseLocation.DRIVER_PROPERTY, DriverDescriptor.class, "getDriver",
                        "setDriver", null, driver);
        loc.setDriver(null);
        assertTrue(loc.getDriver() == null);
View Full Code Here

Examples of org.jitterbit.integration.database.driver.DriverDescriptor

    @Test
    public void ensureManualConnectionStringForODBCWorks() {
        assertTrue(loc.getManualConnectionString() == null);
        loc.setManualConnectionString("");
        assertEquals("", loc.getManualConnectionString());
        DriverDescriptor driver = new OdbcDriverDescriptor("PostgreSQL", "\"", "\"");
        loc.setDriver(driver);
        String connection = "Server=127.0.0.1;Port=5432;Database=myDataBase;User Id=myUsername;Password=myPassword";
        loc.setManualConnectionString(connection);
        assertEquals(connection + ";", loc.getManualConnectionString());
    }
View Full Code Here

Examples of org.jitterbit.integration.database.driver.DriverDescriptor

* @since 1.3.0
*/
public final class DatabaseInfoProviderFactory {

    public static DatabaseInfoProvider createProvider(ConnectionParams params) {
        DriverDescriptor driver = params.getDriver();
        Visitor v = new Visitor();
        driver.accept(v);
        return v.provider;
    }
View Full Code Here

Examples of org.jitterbit.integration.database.driver.DriverDescriptor

        p.store(file);
    }

    private void testPersistOdbc() throws Exception {
        BeginEndQuote quotes = new BeginEndQuote("\"");
        DriverDescriptor driver = OdbcDriverDescriptorFactory.createDescriptor("Postgresql", quotes);
        persist(driver, ODBC_FILE);
    }
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.