|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
public interface JDBCConnection
The main interface of JDBCPersistence that provides methods to manipulate underlying object representations in a database.
Example:
JDBCConnection conn = jdbcPersistence.getConnection();
User user = new UserImpl();
user.setid("the-unique-id");
user.setName('the-unique-name");
user.setFirstName("John");
user.setLastName("Doe");
conn.insert(user);
JDBCPersistence.getConnection(),
JDBCQuery| Field Summary |
|---|
| Fields inherited from interface java.sql.Connection |
|---|
TRANSACTION_NONE, TRANSACTION_READ_COMMITTED, TRANSACTION_READ_UNCOMMITTED, TRANSACTION_REPEATABLE_READ, TRANSACTION_SERIALIZABLE |
| Method Summary | |
|---|---|
int |
delete(java.lang.Object object)
Deletes an object's representation in database. |
int[] |
delete(java.lang.Object[] batch)
Deletes a batch of Objects from database. |
int[] |
executeBatchUpdate(JDBCQuery query,
java.lang.Object[][] params)
Executes batch update and returns a number of rows affected by the update |
java.util.List |
executeQuery(JDBCQuery query,
java.lang.Object[] params,
java.util.List result)
Executes query and returns a List of results that might be a collection of beans or a collection of
Map |
int |
executeUpdate(JDBCQuery query,
java.lang.Object[] params)
Executes update and returns a number of rows affected by the update |
int |
insert(java.lang.Object object)
Inserts data encapsulated by a persistent object into database. |
int[] |
insert(java.lang.Object[] batch)
Inserts a batch of Objects into database. |
java.lang.Object |
load(java.lang.Class clazz,
java.lang.Object[] primaryKey)
Loads object's representation from database, creates an instance of mapped object, sets it's fields and return the instance of mapped object. |
int |
update(java.lang.Object object)
Updates an object's representation in database. |
int[] |
update(java.lang.Object[] batch)
Updates a batch of Objects in database. |
| Methods inherited from interface java.sql.Connection |
|---|
clearWarnings, close, commit, createArrayOf, createBlob, createClob, createNClob, createSQLXML, createStatement, createStatement, createStatement, createStruct, getAutoCommit, getCatalog, getClientInfo, getClientInfo, getHoldability, getMetaData, getTransactionIsolation, getTypeMap, getWarnings, isClosed, isReadOnly, isValid, nativeSQL, prepareCall, prepareCall, prepareCall, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, prepareStatement, releaseSavepoint, rollback, rollback, setAutoCommit, setCatalog, setClientInfo, setClientInfo, setHoldability, setReadOnly, setSavepoint, setSavepoint, setTransactionIsolation, setTypeMap |
| Methods inherited from interface java.sql.Wrapper |
|---|
isWrapperFor, unwrap |
| Method Detail |
|---|
int insert(java.lang.Object object)
throws java.sql.SQLException
object - object encapsulating the data to be inserted
java.sql.SQLException - any SQLException that should occur during the insert propogates up
the call chain
int[] insert(java.lang.Object[] batch)
throws java.sql.SQLException,
java.sql.BatchUpdateException
Objects into database.
Uses batch functionality provided by java.sql.PreparedStatement.
batch - array of Objects to insert
java.sql.SQLException - any SQLException that should occur during the insert propogates up
the call chain
java.sql.BatchUpdateException - any BatchUpdateException that should occur during the insert propogates up
the call chainStatement.executeBatch()
int update(java.lang.Object object)
throws java.sql.SQLException
object - object a representation of which to update
java.sql.SQLException - any SQLException that should occur during the insert propogates up
the call chain
int[] update(java.lang.Object[] batch)
throws java.sql.SQLException,
java.sql.BatchUpdateException
Objects in database. Uses batch functionality provided by java.sql.PreparedStatement.
batch - array of Objects to update
java.sql.SQLException - any SQLException that should occur during the insert propogates up
the call chain
java.sql.BatchUpdateException - any BatchUpdateException that should occur during the insert propogates up
the call chainStatement.executeBatch()
int delete(java.lang.Object object)
throws java.sql.SQLException
object - an object a representation of which to delete
java.sql.SQLException - any SQLException that should occur during the insert propogates up
the call chain
int[] delete(java.lang.Object[] batch)
throws java.sql.SQLException,
java.sql.BatchUpdateException
Objects from database. Uses batch functionality provided by java.sql.PreparedStatement.
batch - array of Objects to delete
java.sql.SQLException - any SQLException that should occur during the insert propogates up
the call chain
java.sql.BatchUpdateException - any BatchUpdateException that should occur during the insert propogates up
the call chainStatement.executeBatch()
java.lang.Object load(java.lang.Class clazz,
java.lang.Object[] primaryKey)
throws java.sql.SQLException
primaryKey - array of objects where each object represents a column of a primary key in the order of columns
in primary key
java.sql.SQLException - any SQLException that should occur during the insert propogates up
the call chain
java.util.List executeQuery(JDBCQuery query,
java.lang.Object[] params,
java.util.List result)
throws java.sql.SQLException
List of results that might be a collection of beans or a collection of
Maps as specified by the query object
- Parameters:
query - query that will be executed.params - parameters to the query, should be given in the order in which they are specified in the queryresult - an java.util.List object or null. If null is passed then an instance of an ArrayList
will be created to hold the results.
- Returns:
List of beans or Map objects.
- Throws:
java.sql.SQLException - any SQLException that should occur during the insert propogates up
the call chain- See Also:
JDBCQuery
int executeUpdate(JDBCQuery query,
java.lang.Object[] params)
throws java.sql.SQLException
query - update that will be executed.params - parameters to the update statement, should be given in the order in which they are specified in the statement
List of beans or Map objects.
java.sql.SQLException - any SQLException that should occur during the insert propogates up
the call chainJDBCQuery
int[] executeBatchUpdate(JDBCQuery query,
java.lang.Object[][] params)
throws java.sql.SQLException,
java.sql.BatchUpdateException
query - org.jdbcpersistence.jdbcQuery object to execute.params - an array of arrays of parameters to the jdbcQuery
java.sql.SQLException - any SQLException that should occur during the insert propogates up
the call chain
java.sql.BatchUpdateException - any BatchUpdateException that should occur during the insert propogates up
the call chainStatement.executeBatch()
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||