Flyway único
git-svn-id: http://desenvolvimento.rjconsultores.com.br/repositorio/sco/BD/FlyWay/trunk@60917 d1611594-4594-4d17-8e1d-87c2c4800839master
parent
1e1ea30f78
commit
f29b83848a
|
@ -0,0 +1,38 @@
|
||||||
|
package com.rjconsultores.ventaboletos.servlet;
|
||||||
|
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.PrintWriter;
|
||||||
|
|
||||||
|
import javax.servlet.ServletException;
|
||||||
|
import javax.servlet.http.HttpServlet;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
|
||||||
|
import com.rjconsultores.ventaboletos.FlyWay;
|
||||||
|
|
||||||
|
public class ReloadFlyway extends HttpServlet {
|
||||||
|
private static final long serialVersionUID = -2076848353707789950L;
|
||||||
|
|
||||||
|
private PrintWriter out = null;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||||
|
out = resp.getWriter();
|
||||||
|
out.println("<h2>Reload Flyway</h2>");
|
||||||
|
|
||||||
|
boolean retorno = FlyWay.getInstance().start();
|
||||||
|
|
||||||
|
if (retorno) {
|
||||||
|
out.print("Processo realizado com sucesso.");
|
||||||
|
} else {
|
||||||
|
out.print("Erro ao executar o flyway. Verifique o log do servidor.");
|
||||||
|
}
|
||||||
|
|
||||||
|
out.close();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
|
||||||
|
doGet(req, resp);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue