01: package org.geotools.data.jdbc;
02:
03: import java.io.IOException;
04: import java.sql.SQLException;
05: import java.sql.Statement;
06:
07: /**
08: * Runnable interface for code blocks to execute against a jdbc connection.
09: *
10: * @author Justin Deoliveira, The Open Planning Project, jdeolive@openplans.org
11: * @see JDBCUtils#run(JDBCDataStore, JDBCRunnable)
12: */
13: public interface JDBCRunnable {
14: /**
15: * Executes a block of code against a statement.
16: * <p>
17: * The block of code may return a value, or <code>null</code>. Code must
18: * not return an "jdbc" objects from this method as the statement is closed
19: * after the block executes and all jdbc objects are released.
20: * </p>
21: *
22: * @param statement A jdbc statement.
23: *
24: * @return An arbitrary value, or <code>null</code>.
25: *
26: * @throws IOException
27: * @throws SQLException
28: */
29: Object run(Statement statement) throws IOException, SQLException;
30: }
|