String sourceTable = "books";
String targetTable = "newbooks";
String driverPath = "org.apache.derby.jdbc.EmbeddedDriver";
String dbUrl = "jdbc:derby:memory:ebookshop";
Configuration cfg = new Configuration();
cfg.setString("driver", driverPath);
cfg.setString("url", dbUrl);
cfg.setString("query", "insert into " + targetTable + " (id, title, author, price, qty) values (?,?,?,?,?)");
cfg.setInteger("fields", 5);
cfg.setClass("type0", IntValue.class);
cfg.setClass("type1", StringValue.class);
cfg.setClass("type2", StringValue.class);
cfg.setClass("type3", FloatValue.class);
cfg.setClass("type4", IntValue.class);
jdbcOutputFormat = new JDBCOutputFormat();
jdbcOutputFormat.configure(cfg);
jdbcOutputFormat.open(0,1);