kz.greetgo.db.JdbcOneConnection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of greetgo.db Show documentation
Show all versions of greetgo.db Show documentation
DB utils using in greetgo!
The newest version!
package kz.greetgo.db;
import java.sql.Connection;
public class JdbcOneConnection implements Jdbc {
private final Connection connection;
public JdbcOneConnection(Connection connection) {
this.connection = connection;
}
@Override
public T execute(ConnectionCallback connectionCallback) {
try {
return connectionCallback.doInConnection(connection);
} catch (Exception e) {
if (e instanceof RuntimeException) throw (RuntimeException) e;
throw new RuntimeException(e);
}
}
}