use of com.adaptris.core.jdbc.JdbcConnection in project interlok by adaptris.
the class JdbcQueryServiceCase method createMetadataServiceNoResult.
protected static JdbcDataQueryService createMetadataServiceNoResult() {
JdbcDataQueryService service = new JdbcDataQueryService();
JdbcConnection connection = new JdbcConnection(PROPERTIES.getProperty(JDBC_QUERYSERVICE_URL), PROPERTIES.getProperty(JDBC_QUERYSERVICE_DRIVER));
service.setConnection(connection);
service.setStatementCreator(new ConfiguredSQLStatement(QUERY_SQL_NO_RESULT));
return service;
}
use of com.adaptris.core.jdbc.JdbcConnection in project interlok by adaptris.
the class JdbcBatchingDataCaptureServiceTest method createJdbcConnection.
@Override
protected JdbcConnection createJdbcConnection() {
JdbcConnection connection = super.createJdbcConnection();
connection.setAutoCommit(false);
return connection;
}
use of com.adaptris.core.jdbc.JdbcConnection in project interlok by adaptris.
the class StaticIdentitySequenceNumberServiceTest method retrieveObjectForSampleConfig.
@Override
protected StaticIdentitySequenceNumberService retrieveObjectForSampleConfig() {
JdbcConnection connection = new JdbcConnection();
connection.setConnectUrl("jdbc:mysql://localhost:3306/mydatabase");
connection.setConnectionAttempts(2);
connection.setConnectionRetryInterval(new TimeInterval(3L, "SECONDS"));
StaticIdentitySequenceNumberService service = new StaticIdentitySequenceNumberService();
service.setIdentity("adaptrismsg");
service.setMetadataKey("sequence_no");
service.setNumberFormat(DEFAULT_NUMBER_FORMAT);
service.setConnection(connection);
service.setOverflowBehaviour(AbstractJdbcSequenceNumberService.OverflowBehaviour.Continue);
return service;
}
use of com.adaptris.core.jdbc.JdbcConnection in project interlok by adaptris.
the class JdbcRawDataCaptureServiceTest method retrieveObjectForSampleConfig.
@Override
protected JdbcRawDataCaptureService retrieveObjectForSampleConfig() {
JdbcRawDataCaptureService service = createService();
JdbcConnection connection = new JdbcConnection();
connection.setConnectUrl("jdbc:mysql://localhost:3306/mydatabase");
connection.setConnectionAttempts(2);
connection.setConnectionRetryInterval(new TimeInterval(3L, "SECONDS"));
service.setConnection(connection);
return service;
}
use of com.adaptris.core.jdbc.JdbcConnection in project interlok by adaptris.
the class JdbcRawDataCaptureServiceTest method createServiceNamedParameters.
private JdbcRawDataCaptureService createServiceNamedParameters(boolean createConnection) {
JdbcRawDataCaptureService service = new JdbcRawDataCaptureService();
if (createConnection) {
JdbcConnection connection = new JdbcConnection();
connection.setConnectUrl(PROPERTIES.getProperty(JDBC_CAPTURE_SERVICE_URL));
connection.setDriverImp(PROPERTIES.getProperty(JDBC_CAPTURE_SERVICE_DRIVER));
service.setConnection(connection);
}
service.setParameterApplicator(new NamedParameterApplicator());
StatementParameter param1 = new StatementParameter(METADATA_KEY, "java.lang.String", StatementParameter.QueryType.metadata);
param1.setName("param1");
service.addStatementParameter(param1);
DateStatementParameter param2 = new DateStatementParameter("timestamp", StatementParameter.QueryType.metadata, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"));
param2.setName("param2");
service.addStatementParameter(param2);
TimestampStatementParameter param3 = new TimestampStatementParameter("timestamp", StatementParameter.QueryType.metadata, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"));
param3.setName("param3");
service.addStatementParameter(param3);
TimeStatementParameter param4 = new TimeStatementParameter("timestamp", StatementParameter.QueryType.metadata, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ"));
param4.setName("param4");
service.addStatementParameter(param4);
StatementParameter param5 = new StatementParameter(null, "java.lang.String", StatementParameter.QueryType.payload);
param5.setName("param5");
service.addStatementParameter(param5);
BytePayloadStatementParameter param6 = new BytePayloadStatementParameter();
param6.setName("param6");
service.addStatementParameter(param6);
CharacterStreamStatementParameter param7 = new CharacterStreamStatementParameter();
param7.setName("param7");
service.addStatementParameter(param7);
BinaryStreamStatementParameter param8 = new BinaryStreamStatementParameter();
param8.setName("param8");
service.addStatementParameter(param8);
StatementParameter param9 = new StatementParameter(null, "java.lang.String", StatementParameter.QueryType.id);
param9.setName("param9");
service.addStatementParameter(param9);
StatementParameter param10 = new StatementParameter(CONSTANT_VALUE, "java.lang.String", StatementParameter.QueryType.constant);
param10.setName("param10");
service.addStatementParameter(param10);
service.setStatement("insert into jdbc_raw_data_capture_basic " + "(string_value, date_value, timestamp_value, time_value, payload_clob, payload_blob, payload_clob2, payload_blob2, id_value, constant_value) " + "values (#param1, #param2, #param3, #param4, #param5, #param6, #param7, #param8, #param9, #param10)");
return service;
}
Aggregations