com.aoindustries.dbc.DatabaseAccess Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ao-dbc Show documentation
Show all versions of ao-dbc Show documentation
Simplified JDBC access for simplified code.
/*
* ao-dbc - Simplified JDBC access for simplified code.
* Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2014, 2015, 2018 AO Industries, Inc.
* [email protected]
* 7262 Bull Pen Cir
* Mobile, AL 36695
*
* This file is part of ao-dbc.
*
* ao-dbc is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* ao-dbc is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with ao-dbc. If not, see .
*/
package com.aoindustries.dbc;
import com.aoindustries.util.IntList;
import com.aoindustries.util.LongList;
import java.math.BigDecimal;
import java.sql.Date;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Timestamp;
import java.sql.Types;
import java.util.Collection;
import java.util.List;
/**
* Wraps and simplifies access to a JDBC database.
*
* @author AO Industries, Inc.
*/
public interface DatabaseAccess {
/**
* These may be used as parameters to represent null values of specific types.
*
* @see Types
* @see PreparedStatement#setNull(int, int)
*/
public enum Null {
BIT(Types.BIT),
TINYINT(Types.TINYINT),
SMALLINT(Types.SMALLINT),
INTEGER(Types.INTEGER),
BIGINT(Types.BIGINT),
FLOAT(Types.FLOAT),
REAL(Types.REAL),
DOUBLE(Types.DOUBLE),
NUMERIC(Types.NUMERIC),
DECIMAL(Types.DECIMAL),
CHAR(Types.CHAR),
VARCHAR(Types.VARCHAR),
LONGVARCHAR(Types.LONGVARCHAR),
DATE(Types.DATE),
TIME(Types.TIME),
TIMESTAMP(Types.TIMESTAMP),
BINARY(Types.BINARY),
VARBINARY(Types.VARBINARY),
LONGVARBINARY(Types.LONGVARBINARY),
NULL(Types.NULL),
OTHER(Types.OTHER),
JAVA_OBJECT(Types.JAVA_OBJECT),
DISTINCT(Types.DISTINCT),
STRUCT(Types.STRUCT),
ARRAY(Types.ARRAY),
BLOB(Types.BLOB),
CLOB(Types.CLOB),
REF(Types.REF),
DATALINK(Types.DATALINK),
BOOLEAN(Types.BOOLEAN),
ROWID(Types.ROWID),
NCHAR(Types.NCHAR),
NVARCHAR(Types.NVARCHAR),
LONGNVARCHAR(Types.LONGNVARCHAR),
NCLOB(Types.NCLOB),
SQLXML(Types.SQLXML);
private final int type;
private Null(int type) {
this.type = type;
}
/**
* @see Types
* @see PreparedStatement#setNull(int, int)
*/
public int getType() {
return type;
}
}
/**
* Read-only query the database with a BigDecimal
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
* - rowRequired =
true
*
*
* @see #executeBigDecimalUpdate(java.lang.String, java.lang.Object...)
*/
BigDecimal executeBigDecimalQuery(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-write query the database with a BigDecimal
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
* - rowRequired =
true
*
*
* @see #executeBigDecimalQuery(java.lang.String, java.lang.Object...)
*/
BigDecimal executeBigDecimalUpdate(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Query the database with a BigDecimal
return type.
*/
BigDecimal executeBigDecimalQuery(int isolationLevel, boolean readOnly, boolean rowRequired, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-only query the database with a boolean
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
* - rowRequired =
true
*
*
* @see #executeBooleanUpdate(java.lang.String, java.lang.Object...)
*/
boolean executeBooleanQuery(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-write query the database with a boolean
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
* - rowRequired =
true
*
*
* @see #executeBooleanQuery(java.lang.String, java.lang.Object...)
*/
boolean executeBooleanUpdate(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Query the database with a boolean
return type.
*/
boolean executeBooleanQuery(int isolationLevel, boolean readOnly, boolean rowRequired, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-only query the database with a byte[]
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
* - rowRequired =
true
*
*
* @see #executeByteArrayUpdate(java.lang.String, java.lang.Object...)
*/
byte[] executeByteArrayQuery(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-write query the database with a byte[]
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
* - rowRequired =
true
*
*
* @see #executeByteArrayQuery(java.lang.String, java.lang.Object...)
*/
byte[] executeByteArrayUpdate(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Query the database with a byte[]
return type.
*/
byte[] executeByteArrayQuery(int isolationLevel, boolean readOnly, boolean rowRequired, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-only query the database with a java.sql.Date
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
* - rowRequired =
true
*
*
* @see #executeDateUpdate(java.lang.String, java.lang.Object...)
*/
Date executeDateQuery(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-write query the database with a java.sql.Date
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
* - rowRequired =
true
*
*
* @see #executeDateQuery(java.lang.String, java.lang.Object...)
*/
Date executeDateUpdate(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Query the database with a java.sql.Date
return type.
*/
Date executeDateQuery(int isolationLevel, boolean readOnly, boolean rowRequired, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-only query the database with an IntList
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
*
*
* @see #executeIntListUpdate(java.lang.String, java.lang.Object...)
*/
IntList executeIntListQuery(String sql, Object ... params) throws SQLException;
/**
* Read-write query the database with an IntList
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
*
*
* @see #executeIntListQuery(java.lang.String, java.lang.Object...)
*/
IntList executeIntListUpdate(String sql, Object ... params) throws SQLException;
/**
* Query the database with an IntList
return type.
*/
IntList executeIntListQuery(int isolationLevel, boolean readOnly, String sql, Object ... params) throws SQLException;
/**
* Read-only query the database with an int
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
* - rowRequired =
true
*
*
* @see #executeIntUpdate(java.lang.String, java.lang.Object...)
*/
int executeIntQuery(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-write query the database with an int
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
* - rowRequired =
true
*
*
* @see #executeIntQuery(java.lang.String, java.lang.Object...)
*/
int executeIntUpdate(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Query the database with an int
return type.
*/
int executeIntQuery(int isolationLevel, boolean readOnly, boolean rowRequired, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-only query the database with a LongList
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
*
*
* @see #executeLongListUpdate(java.lang.String, java.lang.Object...)
*/
LongList executeLongListQuery(String sql, Object ... params) throws SQLException;
/**
* Read-write query the database with a LongList
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
*
*
* @see #executeLongListQuery(java.lang.String, java.lang.Object...)
*/
LongList executeLongListUpdate(String sql, Object ... params) throws SQLException;
/**
* Query the database with a LongList
return type.
*/
LongList executeLongListQuery(int isolationLevel, boolean readOnly, String sql, Object ... params) throws SQLException;
/**
* Read-only query the database with a long
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
* - rowRequired =
true
*
*
* @see #executeLongUpdate(java.lang.String, java.lang.Object...)
*/
long executeLongQuery(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-write query the database with a long
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
* - rowRequired =
true
*
*
* @see #executeLongQuery(java.lang.String, java.lang.Object...)
*/
long executeLongUpdate(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Query the database with a long
return type.
*/
long executeLongQuery(int isolationLevel, boolean readOnly, boolean rowRequired, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-only query the database with a <T>
return type. Class <T> must have a contructor that takes a single argument of ResultSet
.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
* - rowRequired =
true
*
*
* @see #executeObjectUpdate(java.lang.Class, java.lang.String, java.lang.Object...)
*/
T executeObjectQuery(Class clazz, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-write query the database with a <T>
return type. Class <T> must have a contructor that takes a single argument of ResultSet
.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
* - rowRequired =
true
*
*
* @see #executeObjectQuery(java.lang.Class, java.lang.String, java.lang.Object...)
*/
T executeObjectUpdate(Class clazz, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Query the database with a <T>
return type. Class <T> must have a contructor that takes a single argument of ResultSet
.
*/
T executeObjectQuery(int isolationLevel, boolean readOnly, boolean rowRequired, Class clazz, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-only query the database with a <T>
return type, objects are created with the provided factory.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
* - rowRequired =
true
*
*
* @see #executeObjectUpdate(com.aoindustries.dbc.ObjectFactory, java.lang.String, java.lang.Object...)
*/
T executeObjectQuery(ObjectFactory objectFactory, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-write query the database with a <T>
return type, objects are created with the provided factory.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
* - rowRequired =
true
*
*
* @see #executeObjectQuery(com.aoindustries.dbc.ObjectFactory, java.lang.String, java.lang.Object...)
*/
T executeObjectUpdate(ObjectFactory objectFactory, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Query the database with a <T>
return type, objects are created with the provided factory.
*/
T executeObjectQuery(int isolationLevel, boolean readOnly, boolean rowRequired, ObjectFactory objectFactory, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-only query the database with a <T>
return type, objects are created with the provided factory.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
* - rowRequired =
true
*
*
* @see #executeObjectUpdate(java.lang.Class, com.aoindustries.dbc.ObjectFactoryE, java.lang.String, java.lang.Object...)
*/
T executeObjectQuery(Class eClass, ObjectFactoryE objectFactory, String sql, Object ... params) throws NoRowException, SQLException, E;
/**
* Read-write query the database with a <T>
return type, objects are created with the provided factory.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
* - rowRequired =
true
*
*
* @see #executeObjectQuery(java.lang.Class, com.aoindustries.dbc.ObjectFactoryE, java.lang.String, java.lang.Object...)
*/
T executeObjectUpdate(Class eClass, ObjectFactoryE objectFactory, String sql, Object ... params) throws NoRowException, SQLException, E;
/**
* Query the database with a <T>
return type, objects are created with the provided factory.
*/
T executeObjectQuery(int isolationLevel, boolean readOnly, boolean rowRequired, Class eClass, ObjectFactoryE objectFactory, String sql, Object ... params) throws NoRowException, SQLException, E;
/**
* Read-only query the database with a List<T>
return type. Class <T> must have a contructor that takes a single argument of ResultSet
.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
*
*
* @see #executeObjectListUpdate(java.lang.Class, java.lang.String, java.lang.Object...)
*/
List executeObjectListQuery(Class clazz, String sql, Object ... params) throws SQLException;
/**
* Read-write query the database with a List<T>
return type. Class <T> must have a contructor that takes a single argument of ResultSet
.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
*
*
* @see #executeObjectListQuery(java.lang.Class, java.lang.String, java.lang.Object...)
*/
List executeObjectListUpdate(Class clazz, String sql, Object ... params) throws SQLException;
/**
* Query the database with a List<T>
return type. Class <T> must have a contructor that takes a single argument of ResultSet
.
*/
List executeObjectListQuery(int isolationLevel, boolean readOnly, Class clazz, String sql, Object ... params) throws SQLException;
/**
* Read-only query the database with a List<T>
return type, objects are created with the provided factory.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
*
*
* @see #executeObjectListUpdate(com.aoindustries.dbc.ObjectFactory, java.lang.String, java.lang.Object...)
*/
List executeObjectListQuery(ObjectFactory objectFactory, String sql, Object ... params) throws SQLException;
/**
* Read-write query the database with a List<T>
return type, objects are created with the provided factory.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
*
*
* @see #executeObjectListQuery(com.aoindustries.dbc.ObjectFactory, java.lang.String, java.lang.Object...)
*/
List executeObjectListUpdate(ObjectFactory objectFactory, String sql, Object ... params) throws SQLException;
/**
* Query the database with a List<T>
return type, objects are created with the provided factory.
*/
List executeObjectListQuery(int isolationLevel, boolean readOnly, ObjectFactory objectFactory, String sql, Object ... params) throws SQLException;
/**
* Read-only query the database with a List<T>
return type, objects are created with the provided factory.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
*
*
* @see #executeObjectListUpdate(java.lang.Class, com.aoindustries.dbc.ObjectFactoryE, java.lang.String, java.lang.Object...)
*/
List executeObjectListQuery(Class eClass, ObjectFactoryE objectFactory, String sql, Object ... params) throws SQLException, E;
/**
* Read-write query the database with a List<T>
return type, objects are created with the provided factory.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
*
*
* @see #executeObjectListQuery(java.lang.Class, com.aoindustries.dbc.ObjectFactoryE, java.lang.String, java.lang.Object...)
*/
List executeObjectListUpdate(Class eClass, ObjectFactoryE objectFactory, String sql, Object ... params) throws SQLException, E;
/**
* Query the database with a List<T>
return type, objects are created with the provided factory.
*/
List executeObjectListQuery(int isolationLevel, boolean readOnly, Class eClass, ObjectFactoryE objectFactory, String sql, Object ... params) throws SQLException, E;
/**
* Read-only query the database with a Collection<T>
return type. Class <T> must have a contructor that takes a single argument of ResultSet
.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
*
*
* @see #executeObjectCollectionUpdate(java.util.Collection, java.lang.Class, java.lang.String, java.lang.Object...)
*/
> C executeObjectCollectionQuery(C collection, Class clazz, String sql, Object ... params) throws SQLException;
/**
* Read-write query the database with a Collection<T>
return type. Class <T> must have a contructor that takes a single argument of ResultSet
.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
*
*
* @see #executeObjectCollectionQuery(java.util.Collection, java.lang.Class, java.lang.String, java.lang.Object...)
*/
> C executeObjectCollectionUpdate(C collection, Class clazz, String sql, Object ... params) throws SQLException;
/**
* Query the database with a Collection<T>
return type. Class <T> must have a contructor that takes a single argument of ResultSet
.
*/
> C executeObjectCollectionQuery(int isolationLevel, boolean readOnly, C collection, Class clazz, String sql, Object ... params) throws SQLException;
/**
* Read-only query the database with a Collection<T>
return type, objects are created with the provided factory.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
*
*
* @see #executeObjectCollectionUpdate(java.util.Collection, com.aoindustries.dbc.ObjectFactory, java.lang.String, java.lang.Object...)
*/
> C executeObjectCollectionQuery(C collection, ObjectFactory objectFactory, String sql, Object ... params) throws SQLException;
/**
* Read-write query the database with a Collection<T>
return type, objects are created with the provided factory.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
*
*
* @see #executeObjectCollectionQuery(java.util.Collection, com.aoindustries.dbc.ObjectFactory, java.lang.String, java.lang.Object...)
*/
> C executeObjectCollectionUpdate(C collection, ObjectFactory objectFactory, String sql, Object ... params) throws SQLException;
/**
* Query the database with a Collection<T>
return type, objects are created with the provided factory.
*/
> C executeObjectCollectionQuery(int isolationLevel, boolean readOnly, C collection, ObjectFactory objectFactory, String sql, Object ... params) throws SQLException;
/**
* Read-only query the database with a Collection<T>
return type, objects are created with the provided factory.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
*
*
* @see #executeObjectCollectionUpdate(java.util.Collection, java.lang.Class, com.aoindustries.dbc.ObjectFactoryE, java.lang.String, java.lang.Object...)
*/
,E extends Exception> C executeObjectCollectionQuery(C collection, Class eClass, ObjectFactoryE objectFactory, String sql, Object ... params) throws SQLException, E;
/**
* Read-write query the database with a Collection<T>
return type, objects are created with the provided factory.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
*
*
* @see #executeObjectCollectionQuery(java.util.Collection, java.lang.Class, com.aoindustries.dbc.ObjectFactoryE, java.lang.String, java.lang.Object...)
*/
,E extends Exception> C executeObjectCollectionUpdate(C collection, Class eClass, ObjectFactoryE objectFactory, String sql, Object ... params) throws SQLException, E;
/**
* Query the database with a Collection<T>
return type, objects are created with the provided factory.
*/
,E extends Exception> C executeObjectCollectionQuery(int isolationLevel, boolean readOnly, C collection, Class eClass, ObjectFactoryE objectFactory, String sql, Object ... params) throws SQLException, E;
/**
* Read-only query the database, calling the ResultSetHandler
once.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
*
*
* @see #executeUpdate(com.aoindustries.dbc.ResultSetHandler, java.lang.String, java.lang.Object...)
*/
T executeQuery(ResultSetHandler resultSetHandler, String sql, Object ... params) throws SQLException;
/**
* Read-write query the database, calling the ResultSetHandler
once.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
*
*
* @see #executeQuery(com.aoindustries.dbc.ResultSetHandler, java.lang.String, java.lang.Object...)
*/
T executeUpdate(ResultSetHandler resultSetHandler, String sql, Object ... params) throws SQLException;
/**
* Query the database, calling the ResultSetHandler
once.
*/
T executeQuery(int isolationLevel, boolean readOnly, ResultSetHandler resultSetHandler, String sql, Object ... params) throws SQLException;
/**
* Read-only query the database, calling the ResultSetHandlerE
once.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
*
*
* @see #executeUpdate(java.lang.Class, com.aoindustries.dbc.ResultSetHandlerE, java.lang.String, java.lang.Object...)
*/
T executeQuery(Class eClass, ResultSetHandlerE resultSetHandler, String sql, Object ... params) throws SQLException, E;
/**
* Read-write query the database, calling the ResultSetHandlerE
once.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
*
*
* @see #executeQuery(java.lang.Class, com.aoindustries.dbc.ResultSetHandlerE, java.lang.String, java.lang.Object...)
*/
T executeUpdate(Class eClass, ResultSetHandlerE resultSetHandler, String sql, Object ... params) throws SQLException, E;
/**
* Query the database, calling the ResultSetHandlerE
once.
*/
T executeQuery(int isolationLevel, boolean readOnly, Class eClass, ResultSetHandlerE resultSetHandler, String sql, Object ... params) throws SQLException, E;
/**
* Read-only query the database with a List
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
*
*
* @see #executeShortListUpdate(java.lang.String, java.lang.Object...)
*/
List executeShortListQuery(String sql, Object ... params) throws SQLException;
/**
* Read-write query the database with a List
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
*
*
* @see #executeShortListQuery(java.lang.String, java.lang.Object...)
*/
List executeShortListUpdate(String sql, Object ... params) throws SQLException;
/**
* Query the database with a List
return type.
*/
List executeShortListQuery(int isolationLevel, boolean readOnly, String sql, Object ... params) throws SQLException;
/**
* Read-only query the database with a short
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
* - rowRequired =
true
*
*
* @see #executeShortUpdate(java.lang.String, java.lang.Object...)
*/
short executeShortQuery(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-write query the database with a short
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
* - rowRequired =
true
*
*
* @see #executeShortQuery(java.lang.String, java.lang.Object...)
*/
short executeShortUpdate(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Query the database with a short
return type.
*/
short executeShortQuery(int isolationLevel, boolean readOnly, boolean rowRequired, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-only query the database with a String
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
* - rowRequired =
true
*
*
* @see #executeStringUpdate(java.lang.String, java.lang.Object...)
*/
String executeStringQuery(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-write query the database with a String
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
* - rowRequired =
true
*
*
* @see #executeStringQuery(java.lang.String, java.lang.Object...)
*/
String executeStringUpdate(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Query the database with a String
return type.
*/
String executeStringQuery(int isolationLevel, boolean readOnly, boolean rowRequired, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-only query the database with a List<String>
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
*
*
* @see #executeStringListUpdate(java.lang.String, java.lang.Object...)
*/
List executeStringListQuery(String sql, Object ... params) throws SQLException;
/**
* Read-write query the database with a List<String>
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
*
*
* @see #executeStringListQuery(java.lang.String, java.lang.Object...)
*/
List executeStringListUpdate(String sql, Object ... params) throws SQLException;
/**
* Query the database with a List<String>
return type.
*/
List executeStringListQuery(int isolationLevel, boolean readOnly, String sql, Object ... params) throws SQLException;
/**
* Read-only query the database with a Timestamp
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
true
* - rowRequired =
true
*
*
* @see #executeTimestampUpdate(java.lang.String, java.lang.Object...)
*/
Timestamp executeTimestampQuery(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Read-write query the database with a Timestamp
return type.
*
* - isolationLevel =
Connection.TRANSACTION_READ_COMMITTED
* - readOnly =
false
* - rowRequired =
true
*
*
* @see #executeTimestampQuery(java.lang.String, java.lang.Object...)
*/
Timestamp executeTimestampUpdate(String sql, Object ... params) throws NoRowException, SQLException;
/**
* Query the database with a Timestamp
return type.
*/
Timestamp executeTimestampQuery(int isolationLevel, boolean readOnly, boolean rowRequired, String sql, Object ... params) throws NoRowException, SQLException;
/**
* Performs an update on the database and returns the number of rows affected.
*/
int executeUpdate(String sql, Object ... params) throws SQLException;
}