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

org.bitbucket.bradleysmithllc.etlunit.feature.database.JDBCClient Maven / Gradle / Ivy

There is a newer version: 4.6.0-eu
Show newest version
package org.bitbucket.bradleysmithllc.etlunit.feature.database;

import org.bitbucket.bradleysmithllc.etlunit.TestExecutionError;

import javax.inject.Inject;
import java.io.IOException;
import java.sql.*;

public interface JDBCClient
{
	void worksFor(DatabaseImplementation dbi);

	interface ConnectionClient
	{
		void connection(Connection conn, DatabaseConnection connection, String mode, int id) throws Exception;
	}

	void useConnection(DatabaseConnection connection, String mode, ConnectionClient client) throws TestExecutionError;
	void useConnection(DatabaseConnection connection, String mode, ConnectionClient client, int id) throws TestExecutionError;

	interface StatementClient
	{
		void connection(Connection conn, Statement st, DatabaseConnection connection, String mode, int id) throws Exception;
	}

	void useStatement(DatabaseConnection connection, String mode, StatementClient client) throws TestExecutionError;
	void useStatement(DatabaseConnection connection, String mode, StatementClient client, int id) throws TestExecutionError;

	interface PreparedStatementClient
	{
		String prepareText();
		void connection(Connection conn, PreparedStatement st, DatabaseConnection connection, String mode, int id) throws Exception;
	}

	void usePreparedStatement(DatabaseConnection connection, String mode, PreparedStatementClient client) throws TestExecutionError;
	void usePreparedStatement(DatabaseConnection connection, String mode, PreparedStatementClient client, int id) throws TestExecutionError;

	interface CallableStatementClient
	{
		String callText();
		void connection(Connection conn, CallableStatement st, DatabaseConnection connection, String mode, int id) throws Exception;
	}

	void useCallableStatement(DatabaseConnection connection, String mode, CallableStatementClient client) throws TestExecutionError;
	void useCallableStatement(DatabaseConnection connection, String mode, CallableStatementClient client, int id) throws TestExecutionError;

	interface ResultSetClient
	{
		void beginSet(Connection conn, ResultSet st, DatabaseConnection connection, String mode, int id) throws Exception;
		void next(Connection conn, ResultSet st, DatabaseConnection connection, String mode, int id) throws Exception;
		void endSet(Connection conn, DatabaseConnection connection, String mode, int id) throws Exception;
	}

	void useResultSet(DatabaseConnection connection, String mode, ResultSetClient client, String query) throws TestExecutionError;
	void useResultSet(DatabaseConnection connection, String mode, ResultSetClient client, String query, int id) throws TestExecutionError;

	void useResultSetScript(DatabaseConnection connection, String mode, ResultSetClient client, String script) throws TestExecutionError, IOException;
	void useResultSetScript(DatabaseConnection connection, String mode, ResultSetClient client, String script, int id) throws TestExecutionError, IOException;

	void useResultSetScriptResource(DatabaseConnection connection, String mode, ResultSetClient client, String script) throws TestExecutionError, IOException;
	void useResultSetScriptResource(DatabaseConnection connection, String mode, ResultSetClient client, String script, int id) throws TestExecutionError, IOException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy