- All Known Implementing Classes:
ServerChannel
public interface SQLServices
Services for executing SQL statements and database procedures.
Property | Description | Type | Default |
---|---|---|---|
jdbc.«name».appname |
Description of the connection pool | String |
none |
jdbc.«name».driver |
Fully qualified name of the JDBC driver class | String |
none |
jdbc.«name».max.idle |
Maximum number of idle connections in the pool | Integer |
max.total |
jdbc.«name».max.idle.time |
Maximum idle time before a connection is evicted (minutes) | Integer |
0 (forever) |
jdbc.«name».max.total |
Maximum number of connections in the pool | Integer |
8 |
jdbc.«name».max.wait.time |
Maximum time to wait for a free connection (milliseconds) | Integer |
0 (forever) |
jdbc.«name».min.idle |
Minimum number of idle connections in the pool | Integer |
0 |
jdbc.«name».password |
Password of the connecting database user | String |
none |
jdbc.«name».redirect |
Name of real connection pool properties | String |
none |
jdbc.«name».test.query |
SQL statement used to test a connection | String |
none |
jdbc.«name».uri |
JDBC connection URI | String |
required |
jdbc.«name».user |
Name of the connecting database user | String |
none |
-
Method Summary
Modifier and TypeMethodDescription<T> T
executeSQL
(SQLExecutor<T> executor) Allocates a connection from the default pool and executes the supplied SQL executor.<T> T
executeSQL
(SQLExecutor<T> executor, String execName) Allocates a connection from the default pool and executes the supplied SQL executor.<T> T
executeSQL
(String poolName, SQLExecutor<T> executor) Allocates a connection from the specified pool and then executes the supplied SQL executor.<T> T
executeSQL
(String poolName, SQLExecutor<T> executor, String execName) Allocates a connection from the specified pool and then executes the supplied SQL executor.
-
Method Details
-
executeSQL
Allocates a connection from the default pool and executes the supplied SQL executor.This convenience method produces the same result as the following invocation:
executeSQL("default", executor, null);
- Type Parameters:
T
- the type of the value returned by theexecutor
.- Parameters:
executor
- an SQL statement executor.- Returns:
- the value returned by the
executor
. - Throws:
NullPointerException
- ifexecutor
isnull
.SQLException
- if an SQL error occurs.Exception
- if another error occurs.
-
executeSQL
Allocates a connection from the default pool and executes the supplied SQL executor.This convenience method produces the same result as the following invocation:
executeSQL("default", executor, tag);
- Type Parameters:
T
- the type of the value returned by theexecutor
.- Parameters:
executor
- an SQL statement executor.execName
- name of theexecutor
(can be null).- Returns:
- the value returned by the
executor
. - Throws:
NullPointerException
- ifexecutor
isnull
.SQLException
- if an SQL error occurs.Exception
- if another error occurs.
-
executeSQL
Allocates a connection from the specified pool and then executes the supplied SQL executor.This convenience method produces the same result as the following invocation:
executeSQL(poolName, executor, null);
- Type Parameters:
T
- the type of the value returned by theexecutor
.- Parameters:
poolName
- the name of the connection pool.executor
- an SQL statement executor.- Returns:
- the value returned by the
executor
. - Throws:
NullPointerException
- if an argument isnull
.SQLException
- if an SQL error occurs.Exception
- if another error occurs.
-
executeSQL
<T> T executeSQL(String poolName, SQLExecutor<T> executor, String execName) throws SQLException, Exception Allocates a connection from the specified pool and then executes the supplied SQL executor. If the SQL executor returns normally, the connection is committed. If the SQL executor throws an exception, the connection is rollback. In any event, the connection is returned to the pool.- Type Parameters:
T
- the type of the value returned by theexecutor
.- Parameters:
poolName
- the name of the connection pool.executor
- an SQL statement executor.execName
- name of theexecutor
(can be null).- Returns:
- the value returned by the
executor
. - Throws:
NullPointerException
- if an argument isnull
.SQLException
- if an SQL error occurs.Exception
- if another error occurs.
-