connectorTO.setDisplayName("H2Test");
// set the connector configuration using PropertyTO
Set<ConnConfProperty> conf = new HashSet<ConnConfProperty>();
ConnConfPropSchema userSchema = new ConnConfPropSchema();
userSchema.setName("user");
userSchema.setType(String.class.getName());
userSchema.setRequired(false);
ConnConfProperty user = new ConnConfProperty();
user.setSchema(userSchema);
user.setValues(Collections.singletonList("sa"));
ConnConfPropSchema keyColumnSchema = new ConnConfPropSchema();
keyColumnSchema.setName("keyColumn");
keyColumnSchema.setType(String.class.getName());
keyColumnSchema.setRequired(true);
ConnConfProperty keyColumn = new ConnConfProperty();
keyColumn.setSchema(keyColumnSchema);
keyColumn.setValues(Collections.singletonList("id"));
ConnConfPropSchema jdbcUrlTemplateSchema = new ConnConfPropSchema();
jdbcUrlTemplateSchema.setName("jdbcUrlTemplate");
jdbcUrlTemplateSchema.setType(String.class.getName());
jdbcUrlTemplateSchema.setRequired(true);
ConnConfProperty jdbcUrlTemplate = new ConnConfProperty();
jdbcUrlTemplate.setSchema(jdbcUrlTemplateSchema);
jdbcUrlTemplate.setValues(Collections.singletonList("jdbc:h2:tcp://localhost:9092/testdb"));
ConnConfPropSchema passwordColumnSchema = new ConnConfPropSchema();
passwordColumnSchema.setName("passwordColumn");
passwordColumnSchema.setType(String.class.getName());
passwordColumnSchema.setRequired(true);
ConnConfProperty passwordColumn = new ConnConfProperty();
passwordColumn.setSchema(passwordColumnSchema);
passwordColumn.setValues(Collections.singletonList("password"));
ConnConfPropSchema tableSchema = new ConnConfPropSchema();
tableSchema.setName("table");
tableSchema.setType(String.class.getName());
tableSchema.setRequired(true);
ConnConfProperty table = new ConnConfProperty();
table.setSchema(tableSchema);
table.setValues(Collections.singletonList("test"));
ConnConfPropSchema passwordSchema = new ConnConfPropSchema();
passwordSchema.setName("password");
passwordSchema.setType(GuardedString.class.getName());
passwordSchema.setRequired(true);
ConnConfProperty password = new ConnConfProperty();
password.setSchema(passwordSchema);
password.setValues(Collections.singletonList("sa"));
ConnConfPropSchema jdbcDriverSchema = new ConnConfPropSchema();
jdbcDriverSchema.setName("jdbcDriver");
jdbcDriverSchema.setType(String.class.getName());
jdbcDriverSchema.setRequired(true);
ConnConfProperty jdbcDriver = new ConnConfProperty();
jdbcDriver.setSchema(jdbcDriverSchema);
jdbcDriver.setValues(Collections.singletonList("org.h2.Driver"));
conf.add(user);