After Reverse Engineering

The final touch

So, you have reverse engineering classes generated.

There is subfolder with your schema name along with column and table subfloder.

As you see, target reports a single problem:

You have to provide a DataSource implementation, and it's up to you haw to do it.

You may use the default DataSource implementation, depending of your database engine, you may use pooling, you may use @Resource injection if possible.

Example HikariCP Datasource:

private DataSource oracleDatabase(){
        HikariConfig config = new HikariConfig(); 
        config.setJdbcUrl( "jdbc:oracle:thin://@IP:PORT/orcl" );
        config.setUsername( USER ); 
        config.setPassword( PASS ); 
        config.setDriverClassName("oracle.jdbc.OracleDriver"); 
        config.setSchema(SCHEMA); 
        return new HikariDataSource( config ); 
    }



Also, you should set the target as a singleton.
it's also dependable of your framework.

Example:

Complete DataBaseTarget for local H2 database:

Share This Page

FACEBOOK COMMENTS WILL BE SHOWN ONLY WHEN YOUR SITE IS ONLINE

©Elephant Software Klaudiusz Wojtkowiak
e-mail: contact@daobab.io