Search in sources :

Example 1 with JDBCDatastoreDefinition

use of org.talend.components.jdbc.datastore.JDBCDatastoreDefinition in project components by Talend.

the class JDBCDatasetTestIT method createDatasetProperties.

private JDBCDatasetProperties createDatasetProperties(boolean updateSchema) {
    JDBCDatastoreDefinition def = new JDBCDatastoreDefinition();
    JDBCDatastoreProperties datastore = new JDBCDatastoreProperties("datastore");
    datastore.dbTypes.setValue("DERBY");
    datastore.afterDbTypes();
    datastore.jdbcUrl.setValue(allSetting.getJdbcUrl());
    datastore.userId.setValue(allSetting.getUsername());
    datastore.password.setValue(allSetting.getPassword());
    JDBCDatasetProperties dataset = (JDBCDatasetProperties) def.createDatasetProperties(datastore);
    dataset.sql.setValue(DBTestUtils.getSQL(tablename));
    if (updateSchema) {
        updateSchema(dataset);
    }
    return dataset;
}
Also used : JDBCDatastoreDefinition(org.talend.components.jdbc.datastore.JDBCDatastoreDefinition) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) JDBCDatastoreProperties(org.talend.components.jdbc.datastore.JDBCDatastoreProperties)

Example 2 with JDBCDatastoreDefinition

use of org.talend.components.jdbc.datastore.JDBCDatastoreDefinition in project components by Talend.

the class JDBCDatasetOracleTestIT method createDatasetProperties.

private JDBCDatasetProperties createDatasetProperties() {
    JDBCDatastoreDefinition def = new JDBCDatastoreDefinition();
    JDBCDatastoreProperties datastore = new JDBCDatastoreProperties("datastore");
    datastore.dbTypes.setValue("ORACLE");
    datastore.jdbcUrl.setValue(allSetting.getJdbcUrl());
    datastore.userId.setValue(allSetting.getUsername());
    datastore.password.setValue(allSetting.getPassword());
    JDBCDatasetProperties dataset = (JDBCDatasetProperties) def.createDatasetProperties(datastore);
    dataset.sql.setValue(DBTestUtils.getSQL(tablename));
    return dataset;
}
Also used : JDBCDatastoreDefinition(org.talend.components.jdbc.datastore.JDBCDatastoreDefinition) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) JDBCDatastoreProperties(org.talend.components.jdbc.datastore.JDBCDatastoreProperties)

Example 3 with JDBCDatastoreDefinition

use of org.talend.components.jdbc.datastore.JDBCDatastoreDefinition in project components by Talend.

the class JdbcInputTestIT method createCommonJDBCInputProperties.

private JDBCInputProperties createCommonJDBCInputProperties(JDBCInputDefinition definition) {
    JDBCDatastoreDefinition datastore_def = new JDBCDatastoreDefinition();
    JDBCDatastoreProperties datastore_props = new JDBCDatastoreProperties("datastore");
    datastore_props.dbTypes.setValue("DERBY");
    datastore_props.afterDbTypes();
    datastore_props.jdbcUrl.setValue(allSetting.getJdbcUrl());
    datastore_props.userId.setValue(allSetting.getUsername());
    datastore_props.password.setValue(allSetting.getPassword());
    JDBCDatasetProperties dataset = (JDBCDatasetProperties) datastore_def.createDatasetProperties(datastore_props);
    dataset.sql.setValue(DBTestUtils.getSQL(tablename));
    dataset.updateSchema();
    JDBCInputProperties properties = (JDBCInputProperties) definition.createRuntimeProperties();
    properties.setDatasetProperties(dataset);
    return properties;
}
Also used : JDBCDatastoreDefinition(org.talend.components.jdbc.datastore.JDBCDatastoreDefinition) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) JDBCDatastoreProperties(org.talend.components.jdbc.datastore.JDBCDatastoreProperties)

Example 4 with JDBCDatastoreDefinition

use of org.talend.components.jdbc.datastore.JDBCDatastoreDefinition in project components by Talend.

the class JdbcDatasetTestIT method createDatasetProperties.

private JDBCDatasetProperties createDatasetProperties(boolean updateSchema) {
    JDBCDatastoreDefinition def = new JDBCDatastoreDefinition();
    JDBCDatastoreProperties datastore = new JDBCDatastoreProperties("datastore");
    datastore.dbTypes.setValue("DERBY");
    datastore.afterDbTypes();
    datastore.jdbcUrl.setValue(allSetting.getJdbcUrl());
    datastore.userId.setValue(allSetting.getUsername());
    datastore.password.setValue(allSetting.getPassword());
    JDBCDatasetProperties dataset = (JDBCDatasetProperties) def.createDatasetProperties(datastore);
    dataset.sql.setValue(DBTestUtils.getSQL(tablename));
    if (updateSchema) {
        dataset.updateSchema();
    }
    return dataset;
}
Also used : JDBCDatastoreDefinition(org.talend.components.jdbc.datastore.JDBCDatastoreDefinition) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) JDBCDatastoreProperties(org.talend.components.jdbc.datastore.JDBCDatastoreProperties)

Example 5 with JDBCDatastoreDefinition

use of org.talend.components.jdbc.datastore.JDBCDatastoreDefinition in project components by Talend.

the class JDBCInputTestIT method createCommonJDBCInputProperties.

private JDBCInputProperties createCommonJDBCInputProperties(JDBCInputDefinition definition) {
    JDBCDatastoreDefinition datastore_def = new JDBCDatastoreDefinition();
    JDBCDatastoreProperties datastore_props = new JDBCDatastoreProperties("datastore");
    datastore_props.dbTypes.setValue("DERBY");
    datastore_props.afterDbTypes();
    datastore_props.jdbcUrl.setValue(allSetting.getJdbcUrl());
    datastore_props.userId.setValue(allSetting.getUsername());
    datastore_props.password.setValue(allSetting.getPassword());
    JDBCDatasetProperties dataset = (JDBCDatasetProperties) datastore_def.createDatasetProperties(datastore_props);
    dataset.sql.setValue(DBTestUtils.getSQL(tablename));
    updateSchema(dataset);
    JDBCInputProperties properties = (JDBCInputProperties) definition.createRuntimeProperties();
    properties.setDatasetProperties(dataset);
    return properties;
}
Also used : JDBCDatastoreDefinition(org.talend.components.jdbc.datastore.JDBCDatastoreDefinition) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) JDBCDatastoreProperties(org.talend.components.jdbc.datastore.JDBCDatastoreProperties)

Aggregations

JDBCDatasetProperties (org.talend.components.jdbc.dataset.JDBCDatasetProperties)5 JDBCDatastoreDefinition (org.talend.components.jdbc.datastore.JDBCDatastoreDefinition)5 JDBCDatastoreProperties (org.talend.components.jdbc.datastore.JDBCDatastoreProperties)5