Code example for DataSource

Methods: getConnection

0
        ds.setCreateDatabase("create");
        ds.setDatabaseName("target/ExternalVariableTest");
        _ds = ds;
 
        _jdbcext = new JdbcExternalVariableModule();
        _jdbcext.registerDataSource("testds", _ds);
        _server.registerExternalVariableEngine(_jdbcext);
 
        Connection conn = _ds.getConnection();
        Statement s = conn.createStatement();
 
        dropTable(s, "extvartable1");
        s.execute("create table extvartable1 (" + "id1 VARCHAR(200) PRIMARY KEY," +  " \"_id2_\" VARCHAR(200)," +  "pid VARCHAR(250), " + "iid INT,"
                + "cts TIMESTAMP," + "uts TIMESTAMP," + "foo VARCHAR(250)," + "bar VARCHAR(250))"); 
 
        s.execute("insert into extvartable1(id1,pid,foo) values ('123','"
                + new QName("http://ode/bpel/unit-test","HelloWorld2-1").toString()
                + "','thefoo')"); 
 
        dropTable(s, "costPerCustomer");
        s.execute("CREATE TABLE costPerCustomer (value0 varchar(250), key1 varchar(250) primary key)");