mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-23 07:11:55 +00:00
#636 - ENH: Add DB Migration runner (as alternative to running via FlywayDB etc)
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user