Search in sources :

Example 26 with AllSetting

use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.

the class JDBCDatastoreProperties method getRuntimeSetting.

@Override
public AllSetting getRuntimeSetting() {
    AllSetting setting = new AllSetting();
    setting.setDriverPaths(getCurrentDriverPaths());
    setting.setDriverClass(getCurrentDriverClass());
    setting.setJdbcUrl(jdbcUrl.getValue());
    setting.setUsername(userId.getValue());
    setting.setPassword(password.getValue());
    return setting;
}
Also used : AllSetting(org.talend.components.jdbc.runtime.setting.AllSetting)

Example 27 with AllSetting

use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.

the class JDBCInputProperties method getRuntimeSetting.

@Override
public AllSetting getRuntimeSetting() {
    AllSetting setting = new AllSetting();
    JDBCDatasetProperties datasetProperties = this.getDatasetProperties();
    JDBCDatastoreProperties datastoreProperties = datasetProperties.getDatastoreProperties();
    setting.setDriverPaths(datastoreProperties.getCurrentDriverPaths());
    setting.setDriverClass(datastoreProperties.getCurrentDriverClass());
    setting.setJdbcUrl(datastoreProperties.jdbcUrl.getValue());
    setting.setUsername(datastoreProperties.userId.getValue());
    setting.setPassword(datastoreProperties.password.getValue());
    setting.setSql(datasetProperties.sql.getValue());
    setting.setSchema(datasetProperties.main.schema.getValue());
    return setting;
}
Also used : AllSetting(org.talend.components.jdbc.runtime.setting.AllSetting) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) JDBCDatastoreProperties(org.talend.components.jdbc.datastore.JDBCDatastoreProperties)

Example 28 with AllSetting

use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.

the class JDBCOutputProperties method getRuntimeSetting.

@Override
public AllSetting getRuntimeSetting() {
    // TODO only return the Driver paths is enough to get the getRuntimeInfo works, AllSetting should be removed
    // after refactor
    AllSetting setting = new AllSetting();
    JDBCDatasetProperties datasetProperties = this.getDatasetProperties();
    JDBCDatastoreProperties datastoreProperties = datasetProperties.getDatastoreProperties();
    setting.setDriverPaths(datastoreProperties.getCurrentDriverPaths());
    setting.setDriverClass(datastoreProperties.getCurrentDriverClass());
    setting.setJdbcUrl(datastoreProperties.jdbcUrl.getValue());
    setting.setUsername(datastoreProperties.userId.getValue());
    setting.setPassword(datastoreProperties.password.getValue());
    return setting;
}
Also used : AllSetting(org.talend.components.jdbc.runtime.setting.AllSetting) JDBCDatasetProperties(org.talend.components.jdbc.dataset.JDBCDatasetProperties) JDBCDatastoreProperties(org.talend.components.jdbc.datastore.JDBCDatastoreProperties)

Example 29 with AllSetting

use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.

the class TJDBCInputProperties method getRuntimeSetting.

@Override
public AllSetting getRuntimeSetting() {
    AllSetting setting = new AllSetting();
    CommonUtils.setReferenceInfoAndConnectionInfo(setting, referencedComponent, connection);
    setting.setTablename(this.tableSelection.tablename.getValue());
    setting.setSql(this.sql.getValue());
    setting.setUseDataSource(this.useDataSource.getValue());
    setting.setDataSource(this.dataSource.getValue());
    setting.setUseCursor(this.useCursor.getValue());
    setting.setCursor(this.cursor.getValue());
    setting.setTrimStringOrCharColumns(this.trimStringOrCharColumns.getValue());
    setting.setTrims(this.trimTable.trim.getValue());
    setting.setTrimColumns(this.trimTable.columnName.getValue());
    setting.setEnableDBMapping(this.enableDBMapping.getValue());
    setting.setDbMapping(this.dbMapping.getValue());
    setting.setSchema(main.schema.getValue());
    return setting;
}
Also used : AllSetting(org.talend.components.jdbc.runtime.setting.AllSetting)

Example 30 with AllSetting

use of org.talend.components.jdbc.runtime.setting.AllSetting in project components by Talend.

the class TJDBCOutputProperties method getRuntimeSetting.

@Override
public AllSetting getRuntimeSetting() {
    AllSetting setting = new AllSetting();
    CommonUtils.setReferenceInfoAndConnectionInfo(setting, referencedComponent, connection);
    setting.setTablename(this.tableSelection.tablename.getValue());
    setting.setDataAction(this.dataAction.getValue());
    setting.setClearDataInTable(this.clearDataInTable.getValue());
    setting.setDieOnError(this.dieOnError.getValue());
    setting.setUseAutoCommit(this.useDataSource.getValue());
    setting.setDataSource(this.dataSource.getValue());
    setting.setCommitEvery(this.commitEvery.getValue());
    setting.setDebug(this.debug.getValue());
    setting.setUseBatch(this.useBatch.getValue());
    setting.setBatchSize(this.batchSize.getValue());
    setting.setNewDBColumnNames4AdditionalParameters(this.additionalColumns.names.getValue());
    setting.setSqlExpressions4AdditionalParameters(this.additionalColumns.sqlExpressions.getValue());
    setting.setPositions4AdditionalParameters(this.additionalColumns.positions.getValue());
    setting.setReferenceColumns4AdditionalParameters(this.additionalColumns.referenceColumns.getValue());
    setting.setEnableFieldOptions(this.enableFieldOptions.getValue());
    setting.setSchemaColumns4FieldOption(this.fieldOptions.schemaColumns.getValue());
    setting.setInsertable4FieldOption(this.fieldOptions.insertable.getValue());
    setting.setUpdatable4FieldOption(this.fieldOptions.updatable.getValue());
    setting.setUpdateKey4FieldOption(this.fieldOptions.updateKey.getValue());
    setting.setDeletionKey4FieldOption(this.fieldOptions.deletionKey.getValue());
    return setting;
}
Also used : AllSetting(org.talend.components.jdbc.runtime.setting.AllSetting)

Aggregations

AllSetting (org.talend.components.jdbc.runtime.setting.AllSetting)56 Test (org.junit.Test)38 RuntimeInfo (org.talend.daikon.runtime.RuntimeInfo)11 ExecutionEngine (org.talend.components.api.component.runtime.ExecutionEngine)7 JDBCDatastoreProperties (org.talend.components.jdbc.datastore.JDBCDatastoreProperties)6 JDBCDatasetProperties (org.talend.components.jdbc.dataset.JDBCDatasetProperties)4 Connection (java.sql.Connection)3 InputStream (java.io.InputStream)1 URL (java.net.URL)1 URLClassLoader (java.net.URLClassLoader)1 PreparedStatement (java.sql.PreparedStatement)1 SQLException (java.sql.SQLException)1 Statement (java.sql.Statement)1 ArrayList (java.util.ArrayList)1 JarEntry (java.util.jar.JarEntry)1 JarInputStream (java.util.jar.JarInputStream)1 BeforeClass (org.junit.BeforeClass)1 JDBCAvroRegistryString (org.talend.components.jdbc.avro.JDBCAvroRegistryString)1 JDBCConnectionModule (org.talend.components.jdbc.module.JDBCConnectionModule)1 TJDBCConnectionDefinition (org.talend.components.jdbc.tjdbcconnection.TJDBCConnectionDefinition)1