org.xblackcat.sjpu.storage.impl.ABatchedAH Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sjpu-dbah Show documentation
Show all versions of sjpu-dbah Show documentation
Service for generating DB access logic in simple way via interfaces and annotations
package org.xblackcat.sjpu.storage.impl;
import org.xblackcat.sjpu.storage.IBatchedAH;
import org.xblackcat.sjpu.storage.StorageException;
import org.xblackcat.sjpu.storage.connection.IConnectionFactory;
import java.sql.Connection;
import java.sql.SQLException;
/**
* @author xBlackCat Date: 27.07.11
*/
public abstract class ABatchedAH implements IBatchedAH {
protected final Connection con;
public ABatchedAH(IConnectionFactory factory) throws StorageException {
try {
con = factory.getConnection();
} catch (SQLException e) {
throw new StorageException("Failed to borrow connection for Batched Access Helper", e);
}
}
@Override
public void close() throws StorageException {
try {
con.close();
} catch (SQLException e) {
throw new StorageException("Failed to close connection", e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy