use of com.adaptris.core.services.jdbc.DateStatementParameter 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;
}
use of com.adaptris.core.services.jdbc.DateStatementParameter in project interlok by adaptris.
the class JdbcRawDataCaptureServiceTest method createResolveableStatement.
private JdbcRawDataCaptureService createResolveableStatement(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.addStatementParameter(new DateStatementParameter("timestamp", StatementParameter.QueryType.metadata, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")));
service.addStatementParameter(new TimestampStatementParameter("timestamp", StatementParameter.QueryType.metadata, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")));
service.addStatementParameter(new TimeStatementParameter("timestamp", StatementParameter.QueryType.metadata, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")));
service.addStatementParameter(new StatementParameter(null, "java.lang.String", StatementParameter.QueryType.payload));
service.addStatementParameter(new BytePayloadStatementParameter());
service.addStatementParameter(new CharacterStreamStatementParameter());
service.addStatementParameter(new BinaryStreamStatementParameter());
service.addStatementParameter(new StatementParameter(null, "java.lang.String", StatementParameter.QueryType.id));
service.addStatementParameter(new StatementParameter(CONSTANT_VALUE, "java.lang.String", StatementParameter.QueryType.constant));
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 ('%message{jdbcRawDataCaptureServiceTest}', ?, ?, ?, ?, ?, ?, ?, ?, ?)");
return service;
}
use of com.adaptris.core.services.jdbc.DateStatementParameter in project interlok by adaptris.
the class JdbcRawDataCaptureServiceTest method createService.
private JdbcRawDataCaptureService createService(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.addStatementParameter(new StatementParameter(METADATA_KEY, "java.lang.String", StatementParameter.QueryType.metadata));
service.addStatementParameter(new DateStatementParameter("timestamp", StatementParameter.QueryType.metadata, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")));
service.addStatementParameter(new TimestampStatementParameter("timestamp", StatementParameter.QueryType.metadata, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")));
service.addStatementParameter(new TimeStatementParameter("timestamp", StatementParameter.QueryType.metadata, new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ")));
service.addStatementParameter(new StatementParameter(null, "java.lang.String", StatementParameter.QueryType.payload));
service.addStatementParameter(new BytePayloadStatementParameter());
service.addStatementParameter(new CharacterStreamStatementParameter());
service.addStatementParameter(new BinaryStreamStatementParameter());
service.addStatementParameter(new StatementParameter(null, "java.lang.String", StatementParameter.QueryType.id));
service.addStatementParameter(new StatementParameter(CONSTANT_VALUE, "java.lang.String", StatementParameter.QueryType.constant));
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 (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
return service;
}
Aggregations