edu.internet2.middleware.grouperClient.jdbc.GcPreparedStatementCallback Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grouperClient Show documentation
Show all versions of grouperClient Show documentation
Client for Grouper LDAP and Web Services
package edu.internet2.middleware.grouperClient.jdbc;
import java.sql.PreparedStatement;
import java.sql.SQLException;
/**
* Object that gets a preparedStatement back from the connection and the sql - closing it is handled within the framework.
* @param is the type of object that will be returned.
* @author harveycg
*
*/
public abstract class GcPreparedStatementCallback {
/**
* The query to create the callableStatement against.
*/
private String query;
/**
* @return the query
*/
public String getQuery() {
return this.query;
}
/**
* Create a callableStatement from the query given.
* @param _query
*
*/
public GcPreparedStatementCallback(String _query){
this.query = _query;
}
/**
* Get access to the database connection. If no exceptions are thrown, the session will be automatically committed.
* @param preparedStatement is the connection access.
* @throws SQLException is thrown if things go wrong.
* @return the correct type.
*/
public abstract T callback(PreparedStatement preparedStatement) throws SQLException;
}