-
Notifications
You must be signed in to change notification settings - Fork 1
JpoRx Configuration With Vertx3
Francesco edited this page Jul 13, 2015
·
2 revisions
Even if JpoRx can be used without it, it has been developed to be used mainly used with the Vert.x 3 reactive framework. In this case, each Jpo operation is performed in the Vert.x context.
There are two ways of using Jpo with Vert.x. The first way is using a common JDBC dataSource; the second mode uses the Vertx JDBC client (still in development).
import javax.sql.DataSource;
import com.jporm.rx.JpoRx;
import com.jporm.rx.vertx.session.vertx3.JpoRxVertxBuilder;
import io.vertx.core.Vertx;
public JpoRx newInstance(DataSource dataSource, Vertx vertx) {
// Use the JpoRxDataSourceBuilder to create a new instance of JPO.
return new JpoRxVertxBuilder().build(dataSource, vertx);
}