#636 - ENH: Add DB Migration runner (as alternative to running via FlywayDB etc)

This commit is contained in:
Robin Bygrave committed 2016-04-06 14:31:57 +12:00
1 parent a7b239a1b7
commit abaa1ff934
22 files changed
+716 -151

No files matched your search

@@ -15,7 +15,6 @@ public final class EncodeUtil {
/* no instances */
}
/**
* URL-encodes the specified UTF-8 string.
*/
@@ -7,9 +7,10 @@ import java.io.OutputStream;
import java.io.Reader;
/**
* Created by rob on 5/02/16.
* Utilities for IO.
*/
public class IOUtils {
/**
* Reads the entire contents of the specified input stream and returns them
* as a byte array.
@@ -44,6 +45,9 @@ public class IOUtils {
return EncodeUtil.decodeBytes(read(in), encoding);
}
/**
* Read the entire contents from the reader returning as a String.
*/
public static String read(Reader reader) throws IOException {
StringBuilder sb = new StringBuilder();
@@ -23,4 +23,15 @@ public class JdbcClose {
logger.warn("Error closing connection", e);
}
}
/**
* Rollback the connection logging if an error occurs.
*/
public static void rollback(Connection connection) {
try {
connection.rollback();
} catch (SQLException e) {
logger.warn("Error on connection rollback", e);
}
}
}