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

cn.sylinx.hbatis.ds.JdbcBlock Maven / Gradle / Ivy

There is a newer version: 2.0.0.RELEASE
Show newest version
package cn.sylinx.hbatis.ds;

import java.sql.Connection;
import java.sql.SQLException;

import cn.sylinx.hbatis.exception.BlockException;

/**
 * JDBC执行块
 * 
 * @author han
 *
 * @param 
 *            O
 */
public abstract class JdbcBlock implements ResourceBlock {

	@Override
	public O apply(Connection resource) throws BlockException {

		try {
			return applyBlock(resource);
		} catch (Throwable e) {
			throw new BlockException(e);
		}
	}

	/**
	 * 执行快
	 * 
	 * @param resource
	 *            Connection对象
	 * @return O
	 * @throws Exception
	 *             Exception
	 */
	public abstract O applyBlock(Connection resource) throws SQLException;

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy