|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FactoryOperations
The public API for the jOOQ Factory
Factory
Method Summary | ||
---|---|---|
void |
attach(Attachable... attachables)
Attach this Factory to some attachables |
|
void |
attach(Collection<Attachable> attachables)
Attach this Factory to some attachables |
|
Batch |
batch(Collection<? extends Query> queries)
Execute a set of queries in batch mode (without bind values). |
|
Batch |
batch(Query... queries)
Execute a set of queries in batch mode (without bind values). |
|
BatchBindStep |
batch(Query query)
Execute a set of queries in batch mode (with bind values). |
|
Batch |
batchStore(Collection<? extends UpdatableRecord<?>> records)
Execute a set of INSERT and UPDATE queries in
batch mode (with bind values). |
|
Batch |
batchStore(UpdatableRecord<?>... records)
Execute a set of INSERT and UPDATE queries in
batch mode (with bind values). |
|
void |
commit()
Convenience method to access Connection.commit()
Use this method only if you control the JDBC Connection wrapped
by this Configuration , and if that connection manages the current
transaction. |
|
|
currval(Sequence<T> sequence)
Convenience method to fetch the CURRVAL for a sequence directly from this Factory 's underlying JDBC Connection |
|
|
delete(Table<R> table)
Create a new DSL delete statement. |
|
|
deleteQuery(Table<R> table)
Create a new DeleteQuery |
|
int |
execute(String sql)
Execute a query holding plain SQL. |
|
int |
execute(String sql,
Object... bindings)
Execute a new query holding plain SQL. |
|
int |
execute(String sql,
QueryPart... parts)
Execute a new query holding plain SQL. |
|
|
executeDelete(R record)
Delete a record from a table DELETE FROM [table] WHERE [record is supplied record] |
|
|
executeDelete(R record,
Condition condition)
Delete a record from a table DELETE FROM [table] WHERE [condition] |
|
|
executeDelete(Table<R> table)
Deprecated. - 2.5.0 [#1692] - The semantics of executeDelete(TableRecord, Condition) has changed.
This method here is no longer necessary. |
|
|
executeDelete(Table<R> table,
Condition condition)
Deprecated. - 2.5.0 [#1692] - The semantics of executeDelete(TableRecord, Condition) has changed.
This method here is no longer necessary. |
|
|
executeDeleteOne(Table<R> table)
Deprecated. - 2.5.0 [#1692] - The semantics of executeDelete(TableRecord, Condition) has changed.
This method here is no longer necessary. |
|
|
executeDeleteOne(Table<R> table,
Condition condition)
Deprecated. - 2.5.0 [#1692] - The semantics of executeDelete(TableRecord, Condition) has changed.
This method here is no longer necessary. |
|
|
executeInsert(R record)
Insert one record This executes something like the following statement: INSERT INTO [table] ... |
|
|
executeInsert(Table<R> table,
R record)
Deprecated. - 2.5.0 [#1692] - Use executeInsert(TableRecord)
instead |
|
|
executeUpdate(R record)
Update a table UPDATE [table] SET [modified values in record] WHERE [record is supplied record] |
|
|
executeUpdate(R record,
Condition condition)
Update a table UPDATE [table] SET [modified values in record] WHERE [condition] |
|
|
executeUpdate(Table<R> table,
R record)
Deprecated. - 2.5.0 [#1692] - This "mass" update is no longer supported |
|
|
executeUpdate(Table<R> table,
R record,
Condition condition)
Deprecated. - 2.5.0 [#1692] - Use executeUpdate(TableRecord, Condition) instead |
|
|
executeUpdateOne(Table<R> table,
R record)
Deprecated. - 2.5.0 [#1692] - This "mass" update is no longer supported |
|
|
executeUpdateOne(Table<R> table,
R record,
Condition condition)
Deprecated. - 2.5.0 [#1692] - The semantics of executeUpdate(TableRecord, Condition) has changed.
This method here is no longer necessary. |
|
Result<Record> |
fetch(ResultSet rs)
Fetch all data from a JDBC ResultSet and transform it to a jOOQ
Result . |
|
Result<Record> |
fetch(String sql)
Execute a new query holding plain SQL. |
|
Result<Record> |
fetch(String sql,
Object... bindings)
Execute a new query holding plain SQL. |
|
Result<Record> |
fetch(String sql,
QueryPart... parts)
Execute a new query holding plain SQL. |
|
|
fetch(Table<R> table)
Execute and return all records for SELECT * FROM [table]
The result and its contained records are attached to this
Configuration by default. |
|
|
fetch(Table<R> table,
Condition condition)
Execute and return all records for SELECT * FROM [table] WHERE [condition]
The result and its contained records are attached to this
Configuration by default. |
|
|
fetchAny(Table<R> table)
Execute and return zero or one record for SELECT * FROM [table] LIMIT 1
The resulting record is attached to this Configuration by
default. |
|
Result<Record> |
fetchFromCSV(String string)
Fetch all data from a CSV string. |
|
Result<Record> |
fetchFromCSV(String string,
char delimiter)
Fetch all data from a CSV string. |
|
Cursor<Record> |
fetchLazy(ResultSet rs)
Fetch all data from a JDBC ResultSet and transform it to a jOOQ
Result . |
|
Cursor<Record> |
fetchLazy(String sql)
Execute a new query holding plain SQL and "lazily" return the generated result. |
|
Cursor<Record> |
fetchLazy(String sql,
Object... bindings)
Execute a new query holding plain SQL and "lazily" return the generated result. |
|
Cursor<Record> |
fetchLazy(String sql,
QueryPart... parts)
Execute a new query holding plain SQL and "lazily" return the generated result. |
|
List<Result<Record>> |
fetchMany(String sql)
Execute a new query holding plain SQL, possibly returning several result sets Example (Sybase ASE):
String sql = "sp_help 'my_table'";
NOTE: When inserting plain SQL into jOOQ objects, you must
guarantee syntax integrity. |
|
List<Result<Record>> |
fetchMany(String sql,
Object... bindings)
Execute a new query holding plain SQL, possibly returning several result sets. |
|
List<Result<Record>> |
fetchMany(String sql,
QueryPart... parts)
Execute a new query holding plain SQL, possibly returning several result sets. |
|
Record |
fetchOne(String sql)
Execute a new query holding plain SQL. |
|
Record |
fetchOne(String sql,
Object... bindings)
Execute a new query holding plain SQL. |
|
Record |
fetchOne(String sql,
QueryPart... parts)
Execute a new query holding plain SQL. |
|
|
fetchOne(Table<R> table)
Execute and return zero or one record for SELECT * FROM [table]
The resulting record is attached to this Configuration by
default. |
|
|
fetchOne(Table<R> table,
Condition condition)
Execute and return zero or one record for SELECT * FROM [table] WHERE [condition]
The resulting record is attached to this Configuration by
default. |
|
boolean |
getAutoCommit()
Convenience method to access Connection.getAutoCommit()
Use this method only if you control the JDBC Connection wrapped
by this Configuration , and if that connection manages the current
transaction. |
|
int |
getHoldability()
Convenience method to access Connection.getHoldability()
Use this method only if you control the JDBC Connection wrapped
by this Configuration , and if that connection manages the current
transaction. |
|
int |
getTransactionIsolation()
Convenience method to access Connection.getTransactionIsolation()
Use this method only if you control the JDBC Connection wrapped
by this Configuration , and if that connection manages the current
transaction. |
|
|
insertInto(Table<R> into)
Create a new DSL insert statement. |
|
|
insertInto(Table<R> into,
Collection<? extends Field<?>> fields)
Create a new DSL insert statement. |
|
|
insertInto(Table<R> into,
Field<?>... fields)
Create a new DSL insert statement. |
|
|
insertInto(Table<R> into,
Select<?> select)
Deprecated. - 2.0.3 - Use any of these methods instead: |
|
|
insertQuery(Table<R> into)
Create a new InsertQuery |
|
BigInteger |
lastID()
Retrieve the last inserted ID. |
|
|
loadInto(Table<R> table)
Create a new Loader object to load data from a CSV or XML
source |
|
|
mergeInto(Table<R> table)
Create a new DSL SQL standard MERGE statement. |
|
|
mergeInto(Table<R> table,
Collection<? extends Field<?>> fields)
Create a new DSL merge statement (H2-specific syntax) |
|
|
mergeInto(Table<R> table,
Field<?>... fields)
Create a new DSL merge statement (H2-specific syntax) This statement is available from DSL syntax only. |
|
|
newRecord(Table<R> table)
Create a new Record that can be inserted into the corresponding
table. |
|
|
newRecord(Table<R> table,
Object source)
Create a new pre-filled Record that can be inserted into the
corresponding table. |
|
|
newRecord(UDT<R> type)
Create a new UDTRecord . |
|
|
nextval(Sequence<T> sequence)
Convenience method to fetch the NEXTVAL for a sequence directly from this Factory 's underlying JDBC Connection |
|
Query |
query(String sql)
Create a new query holding plain SQL. |
|
Query |
query(String sql,
Object... bindings)
Create a new query holding plain SQL. |
|
Query |
query(String sql,
QueryPart... parts)
Create a new query holding plain SQL. |
|
void |
releaseSavepoint(Savepoint savepoint)
Convenience method to access Connection.releaseSavepoint(Savepoint)
Use this method only if you control the JDBC Connection wrapped
by this Configuration , and if that connection manages the current
transaction. |
|
String |
render(QueryPart part)
Render a QueryPart in the context of this factory This is the same as calling renderContext().render(part) |
|
String |
renderInlined(QueryPart part)
Render a QueryPart in the context of this factory, inlining all bind variables. |
|
String |
renderNamedParams(QueryPart part)
Render a QueryPart in the context of this factory, rendering bind variables as named parameters. |
|
ResultQuery<Record> |
resultQuery(String sql)
Create a new query holding plain SQL. |
|
ResultQuery<Record> |
resultQuery(String sql,
Object... bindings)
Create a new query holding plain SQL. |
|
ResultQuery<Record> |
resultQuery(String sql,
QueryPart... parts)
Create a new query holding plain SQL. |
|
void |
rollback()
Convenience method to access Connection.rollback()
Use this method only if you control the JDBC Connection wrapped
by this Configuration , and if that connection manages the current
transaction. |
|
void |
rollback(Savepoint savepoint)
Convenience method to access Connection.rollback(Savepoint)
Use this method only if you control the JDBC Connection wrapped
by this Configuration , and if that connection manages the current
transaction. |
|
SelectSelectStep |
select(Collection<? extends Field<?>> fields)
Create a new DSL select statement. |
|
SelectSelectStep |
select(Field<?>... fields)
Create a new DSL select statement. |
|
SelectSelectStep |
selectCount()
Create a new DSL select statement for COUNT(*)
Example:
Factory create = new Factory();
create.selectCount()
.from(table1)
.join(table2).on(field1.equal(field2))
.where(field1.greaterThan(100))
.orderBy(field2)
.execute();
|
|
SelectSelectStep |
selectDistinct(Collection<? extends Field<?>> fields)
Create a new DSL select statement. |
|
SelectSelectStep |
selectDistinct(Field<?>... fields)
Create a new DSL select statement. |
|
|
selectFrom(Table<R> table)
Create a new DSL select statement Example:
SELECT * FROM [table] WHERE [conditions] ORDER BY [ordering] LIMIT [limit clause]
|
|
SelectSelectStep |
selectOne()
Create a new DSL select statement for constant 1 literal
Example:
Factory create = new Factory();
create.selectOne()
.from(table1)
.join(table2).on(field1.equal(field2))
.where(field1.greaterThan(100))
.orderBy(field2)
.execute();
|
|
SelectQuery |
selectQuery()
Create a new SelectQuery |
|
|
selectQuery(TableLike<R> table)
Create a new SelectQuery |
|
SelectSelectStep |
selectZero()
Create a new DSL select statement for constant 0 literal
Example:
Factory create = new Factory();
create.selectZero()
.from(table1)
.join(table2).on(field1.equal(field2))
.where(field1.greaterThan(100))
.orderBy(field2)
.execute();
|
|
void |
setAutoCommit(boolean autoCommit)
Convenience method to access Connection.setAutoCommit(boolean)
Use this method only if you control the JDBC Connection wrapped
by this Configuration , and if that connection manages the current
transaction. |
|
void |
setHoldability(int holdability)
Convenience method to access Connection.setHoldability(int)
Use this method only if you control the JDBC Connection wrapped
by this Configuration , and if that connection manages the current
transaction. |
|
Savepoint |
setSavepoint()
Convenience method to access Connection.setSavepoint()
Use this method only if you control the JDBC Connection wrapped
by this Configuration , and if that connection manages the current
transaction. |
|
Savepoint |
setSavepoint(String name)
Convenience method to access Connection.setSavepoint(String)
Use this method only if you control the JDBC Connection wrapped
by this Configuration , and if that connection manages the current
transaction. |
|
void |
setTransactionIsolation(int level)
Convenience method to access Connection.setTransactionIsolation(int)
Use this method only if you control the JDBC Connection wrapped
by this Configuration , and if that connection manages the current
transaction. |
|
|
truncate(Table<R> table)
Create a new DSL truncate statement. |
|
|
update(Table<R> table)
Create a new DSL update statement. |
|
|
updateQuery(Table<R> table)
Create a new UpdateQuery |
|
int |
use(Schema schema)
Use a schema as the default schema of the underlying connection. |
|
int |
use(String schema)
Use a schema as the default schema of the underlying connection. |
Methods inherited from interface org.jooq.Configuration |
---|
getConnection, getData, getData, getDataSource, getDialect, getSchemaMapping, getSettings, setConnection, setData, setDataSource |
Method Detail |
---|
String render(QueryPart part)
This is the same as calling renderContext().render(part)
part
- The QueryPart
to be rendered
String renderNamedParams(QueryPart part)
This is the same as calling
renderContext().namedParams(true).render(part)
part
- The QueryPart
to be rendered
String renderInlined(QueryPart part)
This is the same as calling
renderContext().inline(true).render(part)
part
- The QueryPart
to be rendered
void attach(Attachable... attachables)
Factory
to some attachables
void attach(Collection<Attachable> attachables)
Factory
to some attachables
<R extends TableRecord<R>> LoaderOptionsStep<R> loadInto(Table<R> table)
Loader
object to load data from a CSV or XML
source
Query query(String sql)
Example:
String sql = "SET SCHEMA 'abc'";
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQL
Query query(String sql, Object... bindings)
Example:
String sql = "SET SCHEMA 'abc'";
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQLbindings
- The bindings
Query query(String sql, QueryPart... parts)
Unlike query(String, Object...)
, the SQL passed to this method
should not contain any bind variables. Instead, you can pass
QueryPart
objects to the method which will be rendered at indexed
locations of your SQL string as such:
// The following query
query("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));
// Will render this SQL on an Oracle database with RenderNameStyle.QUOTED:
select ?, 'test' from "DUAL"
NOTE: When inserting plain SQL into jOOQ objects, you must
guarantee syntax integrity. You may also create the possibility of
malicious SQL injection. Be sure to properly use bind variables and/or
escape literals when concatenated into SQL clauses! One way to escape
literals is to use Factory.name(String...)
and similar methods
sql
- The SQL clause, containing {numbered placeholders} where query
parts can be injectedparts
- The QueryPart
objects that are rendered at the
{numbered placeholder} locations
Result<Record> fetch(ResultSet rs) throws DataAccessException
ResultSet
and transform it to a jOOQ
Result
. After fetching all data, the JDBC ResultSet will be
closed.
Use fetchLazy(ResultSet)
, to fetch one Record
at a
time, instead of load the entire ResultSet
into a jOOQ
Result
at once.
rs
- The JDBC ResultSet to fetch data from
DataAccessException
- if something went wrong executing the queryCursor<Record> fetchLazy(ResultSet rs) throws DataAccessException
ResultSet
and transform it to a jOOQ
Result
. After fetching all data, the JDBC ResultSet will be
closed.
Use fetch(ResultSet)
, to load the entire ResultSet
into a jOOQ Result
at once.
rs
- The JDBC ResultSet to fetch data from
DataAccessException
- if something went wrong executing the queryResult<Record> fetchFromCSV(String string) throws DataAccessException
This is the same as calling fetchFromCSV(string, ',')
and
the inverse of calling Result.formatCSV()
. The first row of the
CSV data is required to hold field name information. Subsequent rows may
contain data, which is interpreted as String
. Use the various
conversion methods to retrieve other data types from the
Result
:
Result.getValues(Field, Class)
Result.getValues(int, Class)
Result.getValues(String, Class)
Result.getValues(Field, Converter)
Result.getValues(int, Converter)
Result.getValues(String, Converter)
Missing values result in null
. Empty values result in empty
Strings
string
- The CSV string
DataAccessException
- If anything went wrong parsing the CSV filefetchFromCSV(String, char)
Result<Record> fetchFromCSV(String string, char delimiter) throws DataAccessException
This is inverse of calling Result.formatCSV(char)
. The first row
of the CSV data is required to hold field name information. Subsequent
rows may contain data, which is interpreted as String
. Use the
various conversion methods to retrieve other data types from the
Result
:
Result.getValues(Field, Class)
Result.getValues(int, Class)
Result.getValues(String, Class)
Result.getValues(Field, Converter)
Result.getValues(int, Converter)
Result.getValues(String, Converter)
Missing values result in null
. Empty values result in empty
Strings
string
- The CSV stringdelimiter
- The delimiter to expect between records
DataAccessException
- If anything went wrong parsing the CSV filefetchFromCSV(String)
<R extends Record> SimpleSelectWhereStep<R> selectFrom(Table<R> table)
Example:
SELECT * FROM [table] WHERE [conditions] ORDER BY [ordering] LIMIT [limit clause]
SelectSelectStep select(Field<?>... fields)
Example:
Factory create = new Factory();
create.select(field1, field2)
.from(table1)
.join(table2).on(field1.equal(field2))
.where(field1.greaterThan(100))
.orderBy(field2)
.execute();
SelectSelectStep selectZero()
0
literal
Example:
Factory create = new Factory();
create.selectZero()
.from(table1)
.join(table2).on(field1.equal(field2))
.where(field1.greaterThan(100))
.orderBy(field2)
.execute();
Factory.zero()
SelectSelectStep selectOne()
1
literal
Example:
Factory create = new Factory();
create.selectOne()
.from(table1)
.join(table2).on(field1.equal(field2))
.where(field1.greaterThan(100))
.orderBy(field2)
.execute();
Factory.one()
SelectSelectStep selectCount()
COUNT(*)
Example:
Factory create = new Factory();
create.selectCount()
.from(table1)
.join(table2).on(field1.equal(field2))
.where(field1.greaterThan(100))
.orderBy(field2)
.execute();
SelectSelectStep selectDistinct(Field<?>... fields)
Example:
Factory create = new Factory();
create.selectDistinct(field1, field2)
.from(table1)
.join(table2).on(field1.equal(field2))
.where(field1.greaterThan(100))
.orderBy(field2);
SelectSelectStep select(Collection<? extends Field<?>> fields)
Example:
Factory create = new Factory();
create.select(fields)
.from(table1)
.join(table2).on(field1.equal(field2))
.where(field1.greaterThan(100))
.orderBy(field2);
SelectSelectStep selectDistinct(Collection<? extends Field<?>> fields)
Example:
Factory create = new Factory();
create.selectDistinct(fields)
.from(table1)
.join(table2).on(field1.equal(field2))
.where(field1.greaterThan(100))
.orderBy(field2);
SelectQuery selectQuery()
SelectQuery
<R extends Record> SimpleSelectQuery<R> selectQuery(TableLike<R> table)
SelectQuery
table
- The table to select data from
SelectQuery
<R extends Record> InsertQuery<R> insertQuery(Table<R> into)
InsertQuery
into
- The table to insert data into
InsertQuery
<R extends Record> InsertSetStep<R> insertInto(Table<R> into)
UPDATE
statement's
SET a = b
syntax.
Example:
Factory create = new Factory();
create.insertInto(table)
.set(field1, value1)
.set(field2, value2)
.newRecord()
.set(field1, value3)
.set(field2, value4)
.onDuplicateKeyUpdate()
.set(field1, value1)
.set(field2, value2)
.execute();
<R extends Record> InsertValuesStep<R> insertInto(Table<R> into, Field<?>... fields)
Example:
Factory create = new Factory();
create.insertInto(table, field1, field2)
.values(value1, value2)
.values(value3, value4)
.onDuplicateKeyUpdate()
.set(field1, value1)
.set(field2, value2)
.execute();
<R extends Record> InsertValuesStep<R> insertInto(Table<R> into, Collection<? extends Field<?>> fields)
Example:
Factory create = new Factory();
create.insertInto(table, field1, field2)
.values(value1, value2)
.values(value3, value4)
.onDuplicateKeyUpdate()
.set(field1, value1)
.set(field2, value2)
.execute();
@Deprecated <R extends Record> Insert<R> insertInto(Table<R> into, Select<?> select)
insertInto(Table)
and
InsertSetStep.select(Select)
insertInto(Table, Field...)
and
InsertValuesStep.select(Select)
insertInto(Table, Collection)
and
InsertValuesStep.select(Select)
Example:
Factory create = new Factory();
create.insertInto(table, create.select(1))
.execute();
<R extends Record> UpdateQuery<R> updateQuery(Table<R> table)
UpdateQuery
table
- The table to update data into
UpdateQuery
<R extends Record> UpdateSetStep<R> update(Table<R> table)
Example:
Factory create = new Factory();
create.update(table)
.set(field1, value1)
.set(field2, value2)
.where(field1.greaterThan(100))
.execute();
<R extends Record> MergeUsingStep<R> mergeInto(Table<R> table)
This statement is available from DSL syntax only. It is known to be supported in some way by any of these dialects:
dialect | support type | documentation |
---|---|---|
DB2 | SQL:2008 standard and major enhancements | http://publib.boulder.ibm.com/infocenter/db2luw/v9/index.jsp?topic=/com. ibm.db2.udb.admin.doc/doc/r0010873.htm |
HSQLDB | SQL:2008 standard | http://hsqldb.org/doc/2.0/guide/dataaccess-chapt.html#N129BA |
Oracle | SQL:2008 standard and minor enhancements | http://download.oracle.com/docs/cd/B28359_01/server.111/b28286/ statements_9016.htm |
SQL Server | Similar to SQL:2008 standard with some major enhancements | http://msdn.microsoft.com/de-de/library/bb510625.aspx |
Sybase | Similar to SQL:2008 standard with some major enhancements | http://dcx.sybase.com/1100/en/dbreference_en11/merge-statement.html |
Example:
Factory create = new Factory();
create.mergeInto(table)
.using(select)
.on(condition)
.whenMatchedThenUpdate()
.set(field1, value1)
.set(field2, value2)
.whenNotMatchedThenInsert(field1, field2)
.values(value1, value2)
.execute();
Note: Using this method, you can also create an H2-specific MERGE
statement without field specification. See also
mergeInto(Table, Field...)
<R extends Record> MergeKeyStep<R> mergeInto(Table<R> table, Field<?>... fields)
This statement is available from DSL syntax only. It is known to be supported in some way by any of these dialects:
H2 | H2 natively supports this special syntax | www.h2database.com/html/grammar.html#merge |
DB2, HSQLDB, Oracle, SQL Server, Sybase SQL Anywhere | These databases can simulate the H2-specific MERGE statement using a standard SQL MERGE statement, without restrictions | See mergeInto(Table) for the standard MERGE statement |
<R extends Record> MergeKeyStep<R> mergeInto(Table<R> table, Collection<? extends Field<?>> fields)
mergeInto(Table, Field...)
<R extends Record> DeleteQuery<R> deleteQuery(Table<R> table)
DeleteQuery
table
- The table to delete data from
DeleteQuery
<R extends Record> DeleteWhereStep<R> delete(Table<R> table)
Example:
Factory create = new Factory();
create.delete(table)
.where(field1.greaterThan(100))
.execute();
Batch batch(Query... queries)
This essentially runs the following logic:
Statement s = connection.createStatement();
for (Query query : queries) {
s.addBatch(query.getSQL(true));
}
s.execute();
Statement.executeBatch()
Batch batch(Collection<? extends Query> queries)
This essentially runs the following logic:
Statement s = connection.createStatement();
for (Query query : queries) {
s.addBatch(query.getSQL(true));
}
s.execute();
Statement.executeBatch()
BatchBindStep batch(Query query)
When running
create.batch(query)
.bind(valueA1, valueA2)
.bind(valueB1, valueB2)
.execute();
This essentially runs the following logic:
Statement s = connection.prepareStatement(query.getSQL(false));
for (Object[] bindValues : allBindValues) {
for (Object bindValue : bindValues) {
s.setXXX(bindValue);
}
s.addBatch();
}
s.execute();
Note: bind values will be inlined to a static batch query as in
batch(Query...)
, if you choose to execute queries with
Settings.getStatementType()
== StatementType.STATIC_STATEMENT
Statement.executeBatch()
Batch batchStore(UpdatableRecord<?>... records)
INSERT
and UPDATE
queries in
batch mode (with bind values).
This batch operation can be executed in two modes:
Settings.getStatementType()
== StatementType.PREPARED_STATEMENT
(the default)[number of distinct rendered SQL statements]
. In the worst
case, this corresponds to the number of total records.
The record type order is preserved in the way they are passed to this
method. This is an example of how statements will be ordered:
The above results in
// Let's assume, odd numbers result in INSERTs and even numbers in UPDATES
// Let's also assume a[n] are all of the same type, just as b[n], c[n]...
int[] result = create.batchStore(a1, a2, a3, b1, a4, c1, b3, a5)
.execute();
result.length == 8
and
the following 4 separate batch statements:
Settings.getStatementType()
== StatementType.STATIC_STATEMENT
Statement.executeBatch()
Batch batchStore(Collection<? extends UpdatableRecord<?>> records)
INSERT
and UPDATE
queries in
batch mode (with bind values).
batchStore(UpdatableRecord...)
,
Statement.executeBatch()
<R extends Record> Truncate<R> truncate(Table<R> table)
Example:
Factory create = new Factory();
create.truncate(table)
.execute();
Most dialects implement the TRUNCATE
statement. If it is not
supported, it is simulated using an equivalent DELETE
statement. This is particularly true for these dialects:
Note, this statement is only supported in DSL mode. Immediate execution is omitted for future extensibility of this command.
BigInteger lastID() throws DataAccessException
Note, there are some restrictions to the following dialects:
SQLDialect.DB2
doesn't support thisSQLDialect.ORACLE
doesn't support thisSQLDialect.POSTGRES
doesn't support thisSQLDialect.SQLITE
supports this, but its support is poorly
documented.
null
in some
dialects, if no such number is available.
DataAccessException
- if something went wrong executing the query<T extends Number> T nextval(Sequence<T> sequence) throws DataAccessException
Factory
's underlying JDBC Connection
DataAccessException
- if something went wrong executing the query<T extends Number> T currval(Sequence<T> sequence) throws DataAccessException
Factory
's underlying JDBC Connection
DataAccessException
- if something went wrong executing the queryint use(Schema schema) throws DataAccessException
This has two effects.
USE [schema]
statement is executed on those RDBMS
that support thisSchema
is used as the default schema resulting
in omitting that schema in rendered SQL.
The USE [schema]
statement translates to the various
dialects as follows:
Dialect | Command |
---|---|
DB2 | SET SCHEMA [schema] |
Derby: | SET SCHEMA [schema] |
H2: | SET SCHEMA [schema] |
HSQLDB: | SET SCHEMA [schema] |
MySQL: | USE [schema] |
Oracle: | ALTER SESSION SET CURRENT_SCHEMA = [schema] |
Postgres: | SET SEARCH_PATH = [schema] |
Sybase: | USE [schema] |
DataAccessException
- if something went wrong executing the queryint use(String schema) throws DataAccessException
DataAccessException
- if something went wrong executing the queryuse(Schema)
<R extends UDTRecord<R>> R newRecord(UDT<R> type)
UDTRecord
.
The resulting record is attached to this Configuration
by
default. Use Settings.isAttachRecords()
to override this
behaviour.
R
- The generic record typetype
- The UDT describing records of type <R>
<R extends TableRecord<R>> R newRecord(Table<R> table)
Record
that can be inserted into the corresponding
table.
The resulting record is attached to this Configuration
by
default. Use Settings.isAttachRecords()
to override this
behaviour.
R
- The generic record typetable
- The table holding records of type <R>
<R extends TableRecord<R>> R newRecord(Table<R> table, Object source) throws MappingException
Record
that can be inserted into the
corresponding table.
This performs roughly the inverse operation of Record.into(Class)
The resulting record will have its internal "changed" flags set to true
for all values. This means that UpdatableRecord.store()
will
perform an INSERT
statement. If you wish to store the record
using an UPDATE
statement, use
executeUpdate(UpdatableRecord)
instead.
The resulting record is attached to this Configuration
by
default. Use Settings.isAttachRecords()
to override this
behaviour.
R
- The generic record typetable
- The table holding records of type <R>source
- The source to be used to fill the new record
MappingException
- wrapping any reflection or data type conversion
exception that might have occurred while mapping recordsRecord.from(Object)
,
Record.into(Class)
<R extends Record> Result<R> fetch(Table<R> table) throws DataAccessException
SELECT * FROM [table]
The result and its contained records are attached to this
Configuration
by default. Use Settings.isAttachRecords()
to override this behaviour.
DataAccessException
- if something went wrong executing the query<R extends Record> Result<R> fetch(Table<R> table, Condition condition) throws DataAccessException
SELECT * FROM [table] WHERE [condition]
The result and its contained records are attached to this
Configuration
by default. Use Settings.isAttachRecords()
to override this behaviour.
DataAccessException
- if something went wrong executing the query<R extends Record> R fetchOne(Table<R> table) throws DataAccessException
SELECT * FROM [table]
The resulting record is attached to this Configuration
by
default. Use Settings.isAttachRecords()
to override this
behaviour.
null
if no record was returned
DataAccessException
- if something went wrong executing the query
InvalidResultException
- if the query returned more than one record<R extends Record> R fetchOne(Table<R> table, Condition condition) throws DataAccessException
SELECT * FROM [table] WHERE [condition]
The resulting record is attached to this Configuration
by
default. Use Settings.isAttachRecords()
to override this
behaviour.
null
if no record was returned
DataAccessException
- if something went wrong executing the query
InvalidResultException
- if the query returned more than one record<R extends Record> R fetchAny(Table<R> table) throws DataAccessException
SELECT * FROM [table] LIMIT 1
The resulting record is attached to this Configuration
by
default. Use Settings.isAttachRecords()
to override this
behaviour.
null
if no record was returned
DataAccessException
- if something went wrong executing the query@Deprecated <R extends TableRecord<R>> int executeInsert(Table<R> table, R record) throws DataAccessException
executeInsert(TableRecord)
instead
INSERT INTO [table] ... VALUES [record]
DataAccessException
- if something went wrong executing the query<R extends TableRecord<R>> int executeInsert(R record) throws DataAccessException
This executes something like the following statement:
INSERT INTO [table] ... VALUES [record]
Unlike UpdatableRecord.store()
, this does not change any of the
argument record
's internal "changed" flags, such that a
subsequent call to UpdatableRecord.store()
might lead to another
INSERT
statement being executed.
DataAccessException
- if something went wrong executing the query@Deprecated <R extends TableRecord<R>> int executeUpdate(Table<R> table, R record) throws DataAccessException
UPDATE [table] SET [modified values in record]
DataAccessException
- if something went wrong executing the query@Deprecated <R extends TableRecord<R>,T> int executeUpdate(Table<R> table, R record, Condition condition) throws DataAccessException
executeUpdate(TableRecord, Condition)
instead
UPDATE [table] SET [modified values in record] WHERE [condition]
DataAccessException
- if something went wrong executing the query@Deprecated <R extends TableRecord<R>> int executeUpdateOne(Table<R> table, R record) throws DataAccessException
UPDATE [table] SET [modified values in record]
DataAccessException
- if something went wrong executing the query@Deprecated <R extends TableRecord<R>,T> int executeUpdateOne(Table<R> table, R record, Condition condition) throws DataAccessException
executeUpdate(TableRecord, Condition)
has changed.
This method here is no longer necessary.
UPDATE [table] SET [modified values in record] WHERE [condition]
DataAccessException
- if something went wrong executing the query<R extends UpdatableRecord<R>> int executeUpdate(R record) throws DataAccessException
UPDATE [table] SET [modified values in record] WHERE [record is supplied record]
DataAccessException
- if something went wrong executing the query<R extends TableRecord<R>,T> int executeUpdate(R record, Condition condition) throws DataAccessException
UPDATE [table] SET [modified values in record] WHERE [condition]
DataAccessException
- if something went wrong executing the query<R extends UpdatableRecord<R>> int executeDelete(R record) throws DataAccessException
DELETE FROM [table] WHERE [record is supplied record]
DataAccessException
- if something went wrong executing the query<R extends TableRecord<R>,T> int executeDelete(R record, Condition condition) throws DataAccessException
DELETE FROM [table] WHERE [condition]
DataAccessException
- if something went wrong executing the query@Deprecated <R extends TableRecord<R>> int executeDelete(Table<R> table) throws DataAccessException
executeDelete(TableRecord, Condition)
has changed.
This method here is no longer necessary.
DELETE FROM [table]
DataAccessException
- if something went wrong executing the query@Deprecated <R extends TableRecord<R>,T> int executeDelete(Table<R> table, Condition condition) throws DataAccessException
executeDelete(TableRecord, Condition)
has changed.
This method here is no longer necessary.
DELETE FROM [table] WHERE [condition]
DataAccessException
- if something went wrong executing the query.@Deprecated <R extends TableRecord<R>> int executeDeleteOne(Table<R> table) throws DataAccessException
executeDelete(TableRecord, Condition)
has changed.
This method here is no longer necessary.
DELETE FROM [table]
DataAccessException
- if something went wrong executing the query@Deprecated <R extends TableRecord<R>,T> int executeDeleteOne(Table<R> table, Condition condition) throws DataAccessException
executeDelete(TableRecord, Condition)
has changed.
This method here is no longer necessary.
DELETE FROM [table] WHERE [condition]
DataAccessException
- if something went wrong executing the queryResult<Record> fetch(String sql) throws DataAccessException
Example (Postgres):
Example
(SQLite):
String sql = "FETCH ALL IN \"
String sql = "pragma table_info('my_table')";
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQL
null
, even if the database returns no
ResultSet
DataAccessException
- if something went wrong executing the queryResult<Record> fetch(String sql, Object... bindings) throws DataAccessException
Example (Postgres):
Example
(SQLite):
String sql = "FETCH ALL IN \"
String sql = "pragma table_info('my_table')";
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQLbindings
- The bindings
null
, even if the database returns no
ResultSet
DataAccessException
- if something went wrong executing the queryResult<Record> fetch(String sql, QueryPart... parts) throws DataAccessException
Unlike fetch(String, Object...)
, the SQL passed to this method
should not contain any bind variables. Instead, you can pass
QueryPart
objects to the method which will be rendered at indexed
locations of your SQL string as such:
// The following query
fetch("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));
// Will execute this SQL on an Oracle database with RenderNameStyle.QUOTED:
select ?, 'test' from "DUAL"
NOTE: When inserting plain SQL into jOOQ objects, you must
guarantee syntax integrity. You may also create the possibility of
malicious SQL injection. Be sure to properly use bind variables and/or
escape literals when concatenated into SQL clauses! One way to escape
literals is to use Factory.name(String...)
and similar methods
sql
- The SQL clause, containing {numbered placeholders} where query
parts can be injectedparts
- The QueryPart
objects that are rendered at the
{numbered placeholder} locations
DataAccessException
- if something went wrong executing the queryCursor<Record> fetchLazy(String sql) throws DataAccessException
The returned Cursor
holds a reference to the executed
PreparedStatement
and the associated ResultSet
. Data can
be fetched (or iterated over) lazily, fetching records from the
ResultSet
one by one.
Example (Postgres):
Example
(SQLite):
String sql = "FETCH ALL IN \"
String sql = "pragma table_info('my_table')";
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQL
null
, even if the database returns no
ResultSet
DataAccessException
- if something went wrong executing the queryCursor<Record> fetchLazy(String sql, QueryPart... parts) throws DataAccessException
The returned Cursor
holds a reference to the executed
PreparedStatement
and the associated ResultSet
. Data can
be fetched (or iterated over) lazily, fetching records from the
ResultSet
one by one.
Unlike fetchLazy(String, Object...)
, the SQL passed to this
method should not contain any bind variables. Instead, you can pass
QueryPart
objects to the method which will be rendered at indexed
locations of your SQL string as such:
// The following query
fetchLazy("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));
// Will execute this SQL on an Oracle database with RenderNameStyle.QUOTED:
select ?, 'test' from "DUAL"
NOTE: When inserting plain SQL into jOOQ objects, you must
guarantee syntax integrity. You may also create the possibility of
malicious SQL injection. Be sure to properly use bind variables and/or
escape literals when concatenated into SQL clauses! One way to escape
literals is to use Factory.name(String...)
and similar methods
sql
- The SQL clause, containing {numbered placeholders} where query
parts can be injectedparts
- The QueryPart
objects that are rendered at the
{numbered placeholder} locations
DataAccessException
- if something went wrong executing the queryCursor<Record> fetchLazy(String sql, Object... bindings) throws DataAccessException
The returned Cursor
holds a reference to the executed
PreparedStatement
and the associated ResultSet
. Data can
be fetched (or iterated over) lazily, fetching records from the
ResultSet
one by one.
Example (Postgres):
Example
(SQLite):
String sql = "FETCH ALL IN \"
String sql = "pragma table_info('my_table')";
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQLbindings
- The bindings
null
, even if the database returns no
ResultSet
DataAccessException
- if something went wrong executing the queryList<Result<Record>> fetchMany(String sql) throws DataAccessException
Example (Sybase ASE):
String sql = "sp_help 'my_table'";
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQL
null
, even if the database returns no
ResultSet
DataAccessException
- if something went wrong executing the queryList<Result<Record>> fetchMany(String sql, Object... bindings) throws DataAccessException
Example (Sybase ASE):
String sql = "sp_help 'my_table'";
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQLbindings
- The bindings
null
, even if the database returns no
ResultSet
DataAccessException
- if something went wrong executing the queryList<Result<Record>> fetchMany(String sql, QueryPart... parts) throws DataAccessException
Unlike fetchMany(String, Object...)
, the SQL passed to this
method should not contain any bind variables. Instead, you can pass
QueryPart
objects to the method which will be rendered at indexed
locations of your SQL string as such:
// The following query
fetchMany("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));
// Will execute this SQL on an Oracle database with RenderNameStyle.QUOTED:
select ?, 'test' from "DUAL"
NOTE: When inserting plain SQL into jOOQ objects, you must
guarantee syntax integrity. You may also create the possibility of
malicious SQL injection. Be sure to properly use bind variables and/or
escape literals when concatenated into SQL clauses! One way to escape
literals is to use Factory.name(String...)
and similar methods
sql
- The SQL clause, containing {numbered placeholders} where query
parts can be injectedparts
- The QueryPart
objects that are rendered at the
{numbered placeholder} locations
DataAccessException
- if something went wrong executing the queryRecord fetchOne(String sql) throws DataAccessException
Example (Postgres):
Example
(SQLite):
String sql = "FETCH ALL IN \"
String sql = "pragma table_info('my_table')";
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQL
null
, even if the database returns no
ResultSet
DataAccessException
- if something went wrong executing the query
InvalidResultException
- if the query returned more than one recordRecord fetchOne(String sql, Object... bindings) throws DataAccessException
Example (Postgres):
Example
(SQLite):
String sql = "FETCH ALL IN \"
String sql = "pragma table_info('my_table')";
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQLbindings
- The bindings
null
if the database returned no records
DataAccessException
- if something went wrong executing the query
InvalidResultException
- if the query returned more than one recordRecord fetchOne(String sql, QueryPart... parts) throws DataAccessException
Unlike fetchOne(String, Object...)
, the SQL passed to this
method should not contain any bind variables. Instead, you can pass
QueryPart
objects to the method which will be rendered at indexed
locations of your SQL string as such:
// The following query
fetchOne("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));
// Will execute this SQL on an Oracle database with RenderNameStyle.QUOTED:
select ?, 'test' from "DUAL"
NOTE: When inserting plain SQL into jOOQ objects, you must
guarantee syntax integrity. You may also create the possibility of
malicious SQL injection. Be sure to properly use bind variables and/or
escape literals when concatenated into SQL clauses! One way to escape
literals is to use Factory.name(String...)
and similar methods
sql
- The SQL clause, containing {numbered placeholders} where query
parts can be injectedparts
- The QueryPart
objects that are rendered at the
{numbered placeholder} locations
null
if the database returned no records
DataAccessException
- if something went wrong executing the query
InvalidResultException
- if the query returned more than one recordint execute(String sql) throws DataAccessException
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQL
DataAccessException
- if something went wrong executing the queryint execute(String sql, Object... bindings) throws DataAccessException
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQLbindings
- The bindings
DataAccessException
- if something went wrong executing the queryint execute(String sql, QueryPart... parts) throws DataAccessException
Unlike execute(String, Object...)
, the SQL passed to this method
should not contain any bind variables. Instead, you can pass
QueryPart
objects to the method which will be rendered at indexed
locations of your SQL string as such:
// The following query
execute("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));
// Will execute this SQL on an Oracle database with RenderNameStyle.QUOTED:
select ?, 'test' from "DUAL"
NOTE: When inserting plain SQL into jOOQ objects, you must
guarantee syntax integrity. You may also create the possibility of
malicious SQL injection. Be sure to properly use bind variables and/or
escape literals when concatenated into SQL clauses! One way to escape
literals is to use Factory.name(String...)
and similar methods
sql
- The SQL clause, containing {numbered placeholders} where query
parts can be injectedparts
- The QueryPart
objects that are rendered at the
{numbered placeholder} locations
DataAccessException
- if something went wrong executing the queryResultQuery<Record> resultQuery(String sql) throws DataAccessException
Use this method, when you want to take advantage of the many ways to
fetch results in jOOQ, using ResultQuery
. Some examples:
ResultQuery.fetchLazy() |
Open a cursor and fetch records one by one |
ResultQuery.fetchInto(Class) |
Fetch records into a custom POJO (optionally annotated with JPA annotations) |
ResultQuery.fetchInto(RecordHandler) |
Fetch records into a custom callback (similar to Spring's RowMapper) |
ResultQuery.fetchLater() |
Fetch records of a long-running query asynchronously |
Example (Postgres):
Example
(SQLite):
String sql = "FETCH ALL IN \"
String sql = "pragma table_info('my_table')";
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQL
DataAccessException
- if something went wrong executing the queryResultQuery<Record> resultQuery(String sql, Object... bindings)
Use this method, when you want to take advantage of the many ways to
fetch results in jOOQ, using ResultQuery
. Some examples:
ResultQuery.fetchLazy() |
Open a cursor and fetch records one by one |
ResultQuery.fetchInto(Class) |
Fetch records into a custom POJO (optionally annotated with JPA annotations) |
ResultQuery.fetchInto(RecordHandler) |
Fetch records into a custom callback (similar to Spring's RowMapper) |
ResultQuery.fetchLater() |
Fetch records of a long-running query asynchronously |
Example (Postgres):
Example
(SQLite):
String sql = "FETCH ALL IN \"
String sql = "pragma table_info('my_table')";
NOTE: When inserting plain SQL into jOOQ objects, you must guarantee syntax integrity. You may also create the possibility of malicious SQL injection. Be sure to properly use bind variables and/or escape literals when concatenated into SQL clauses!
sql
- The SQLbindings
- The bindings
ResultQuery<Record> resultQuery(String sql, QueryPart... parts)
Unlike resultQuery(String, Object...)
, the SQL passed to this
method should not contain any bind variables. Instead, you can pass
QueryPart
objects to the method which will be rendered at indexed
locations of your SQL string as such:
// The following query
resultQuery("select {0}, {1} from {2}", val(1), inline("test"), name("DUAL"));
// Will render this SQL on an Oracle database with RenderNameStyle.QUOTED:
select ?, 'test' from "DUAL"
NOTE: When inserting plain SQL into jOOQ objects, you must
guarantee syntax integrity. You may also create the possibility of
malicious SQL injection. Be sure to properly use bind variables and/or
escape literals when concatenated into SQL clauses! One way to escape
literals is to use Factory.name(String...)
and similar methods
sql
- The SQL clause, containing {numbered placeholders} where query
parts can be injectedparts
- The QueryPart
objects that are rendered at the
{numbered placeholder} locations
int getTransactionIsolation() throws DataAccessException
Connection.getTransactionIsolation()
Use this method only if you control the JDBC Connection
wrapped
by this Configuration
, and if that connection manages the current
transaction. If your transaction is operated on a distributed
javax.transaction.UserTransaction
, for instance, this method
will not work.
DataAccessException
Configuration.setConnection(Connection)
,
Configuration.setDataSource(DataSource)
void setTransactionIsolation(int level) throws DataAccessException
Connection.setTransactionIsolation(int)
Use this method only if you control the JDBC Connection
wrapped
by this Configuration
, and if that connection manages the current
transaction. If your transaction is operated on a distributed
javax.transaction.UserTransaction
, for instance, this method
will not work.
DataAccessException
Configuration.setConnection(Connection)
,
Configuration.setDataSource(DataSource)
int getHoldability() throws DataAccessException
Connection.getHoldability()
Use this method only if you control the JDBC Connection
wrapped
by this Configuration
, and if that connection manages the current
transaction. If your transaction is operated on a distributed
javax.transaction.UserTransaction
, for instance, this method
will not work.
DataAccessException
Configuration.setConnection(Connection)
,
Configuration.setDataSource(DataSource)
void setHoldability(int holdability) throws DataAccessException
Connection.setHoldability(int)
Use this method only if you control the JDBC Connection
wrapped
by this Configuration
, and if that connection manages the current
transaction. If your transaction is operated on a distributed
javax.transaction.UserTransaction
, for instance, this method
will not work.
DataAccessException
Configuration.setConnection(Connection)
,
Configuration.setDataSource(DataSource)
boolean getAutoCommit() throws DataAccessException
Connection.getAutoCommit()
Use this method only if you control the JDBC Connection
wrapped
by this Configuration
, and if that connection manages the current
transaction. If your transaction is operated on a distributed
javax.transaction.UserTransaction
, for instance, this method
will not work.
DataAccessException
Configuration.setConnection(Connection)
,
Configuration.setDataSource(DataSource)
void setAutoCommit(boolean autoCommit) throws DataAccessException
Connection.setAutoCommit(boolean)
Use this method only if you control the JDBC Connection
wrapped
by this Configuration
, and if that connection manages the current
transaction. If your transaction is operated on a distributed
javax.transaction.UserTransaction
, for instance, this method
will not work.
DataAccessException
Configuration.setConnection(Connection)
,
Configuration.setDataSource(DataSource)
void releaseSavepoint(Savepoint savepoint) throws DataAccessException
Connection.releaseSavepoint(Savepoint)
Use this method only if you control the JDBC Connection
wrapped
by this Configuration
, and if that connection manages the current
transaction. If your transaction is operated on a distributed
javax.transaction.UserTransaction
, for instance, this method
will not work.
DataAccessException
Configuration.setConnection(Connection)
,
Configuration.setDataSource(DataSource)
Savepoint setSavepoint(String name) throws DataAccessException
Connection.setSavepoint(String)
Use this method only if you control the JDBC Connection
wrapped
by this Configuration
, and if that connection manages the current
transaction. If your transaction is operated on a distributed
javax.transaction.UserTransaction
, for instance, this method
will not work.
DataAccessException
Configuration.setConnection(Connection)
,
Configuration.setDataSource(DataSource)
Savepoint setSavepoint() throws DataAccessException
Connection.setSavepoint()
Use this method only if you control the JDBC Connection
wrapped
by this Configuration
, and if that connection manages the current
transaction. If your transaction is operated on a distributed
javax.transaction.UserTransaction
, for instance, this method
will not work.
DataAccessException
Configuration.setConnection(Connection)
,
Configuration.setDataSource(DataSource)
void rollback(Savepoint savepoint) throws DataAccessException
Connection.rollback(Savepoint)
Use this method only if you control the JDBC Connection
wrapped
by this Configuration
, and if that connection manages the current
transaction. If your transaction is operated on a distributed
javax.transaction.UserTransaction
, for instance, this method
will not work.
DataAccessException
Configuration.setConnection(Connection)
,
Configuration.setDataSource(DataSource)
void rollback() throws DataAccessException
Connection.rollback()
Use this method only if you control the JDBC Connection
wrapped
by this Configuration
, and if that connection manages the current
transaction. If your transaction is operated on a distributed
javax.transaction.UserTransaction
, for instance, this method
will not work.
DataAccessException
Configuration.setConnection(Connection)
,
Configuration.setDataSource(DataSource)
void commit() throws DataAccessException
Connection.commit()
Use this method only if you control the JDBC Connection
wrapped
by this Configuration
, and if that connection manages the current
transaction. If your transaction is operated on a distributed
javax.transaction.UserTransaction
, for instance, this method
will not work.
DataAccessException
Configuration.setConnection(Connection)
,
Configuration.setDataSource(DataSource)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |