diff --git a/src/com/rjconsultores/ventaboletos/RunFlyway.java b/src/com/rjconsultores/ventaboletos/RunFlyway.java new file mode 100644 index 000000000..13578e594 --- /dev/null +++ b/src/com/rjconsultores/ventaboletos/RunFlyway.java @@ -0,0 +1,30 @@ +package com.rjconsultores.ventaboletos; + +import java.sql.SQLException; +import oracle.jdbc.pool.OracleDataSource; + + +public class RunFlyway { + public static void main(String args[]) { + OracleDataSource oracleDS = null; + try { + oracleDS = new OracleDataSource(); + oracleDS.setURL(System.getProperty("database.host")); + oracleDS.setUser(System.getProperty("database.user")); + oracleDS.setPassword(System.getProperty("database.password")); + + FlyWay.getInstance().defineDataSource(oracleDS); + FlyWay.getInstance().start(); + + } catch (SQLException e) { + e.printStackTrace(); + } finally { + if (oracleDS != null) { + try {oracleDS.close(); + } catch (SQLException e) { + e.printStackTrace(); + } + } + } + } +}