Added wrapper methods for auto commit and commit

Signed-off-by: Jim Martens <github@2martens.de>
This commit is contained in:
2017-06-28 16:54:33 +02:00
parent 532f54d19a
commit b32a382c5c

View File

@ -23,6 +23,22 @@ public class ORM {
_connection = _dbManager.getConnection(); _connection = _dbManager.getConnection();
} }
public void setAutoCommit(boolean autoCommit) {
try {
_connection.setAutoCommit(autoCommit);
} catch (SQLException e) {
e.printStackTrace();
}
}
public void commit() {
try {
_connection.commit();
} catch (SQLException e) {
e.printStackTrace();
}
}
public List<Article> getArticles() public List<Article> getArticles()
{ {
List<Article> articles = new ArrayList<>(); List<Article> articles = new ArrayList<>();