All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.internet2.middleware.grouperClient.jdbc.GcPreparedStatementCallback Maven / Gradle / Ivy

There is a newer version: 5.12.2
Show newest version
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; }




© 2015 - 2024 Weber Informatics LLC | Privacy Policy