package io.trygvis.persistence.sql; import java.sql.Connection; import java.sql.SQLException; import java.sql.Statement; import java.util.List; public class SqlSession { // TODO: Make private public final Connection c; public SqlSession(Connection c) { this.c = c; } public void commit() throws SQLException { c.commit(); } public void close() throws SQLException { c.close(); } public void executeUpdate(String sql) throws SQLException { Statement stmt = c.createStatement(); stmt.executeUpdate(sql); } public List query(SqlExecutor.QueryCommand query) throws SQLException { return query.run(c); } }