Search in sources :

Example 16 with JDBCDatastoreProperties

use of org.talend.components.jdbc.datastore.JDBCDatastoreProperties 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

JDBCDatastoreProperties (org.talend.components.jdbc.datastore.JDBCDatastoreProperties)16 JDBCDatasetProperties (org.talend.components.jdbc.dataset.JDBCDatasetProperties)12 Test (org.junit.Test)7 AllSetting (org.talend.components.jdbc.runtime.setting.AllSetting)6 JDBCDatastoreDefinition (org.talend.components.jdbc.datastore.JDBCDatastoreDefinition)5 ObjectNode (com.fasterxml.jackson.databind.node.ObjectNode)2 Response (com.jayway.restassured.response.Response)2 SpringBootTest (org.springframework.boot.test.context.SpringBootTest)2 SerPropertiesDto (org.talend.components.service.rest.dto.SerPropertiesDto)2 Connection (java.sql.Connection)1 PreparedStatement (java.sql.PreparedStatement)1 ResultSet (java.sql.ResultSet)1 Statement (java.sql.Statement)1 HashMap (java.util.HashMap)1 Schema (org.apache.avro.Schema)1 PipelineResult (org.apache.beam.sdk.PipelineResult)1 JDBCInputProperties (org.talend.components.jdbc.dataprep.JDBCInputProperties)1 JDBCOutputProperties (org.talend.components.jdbc.datastream.JDBCOutputProperties)1