| |
- __builtin__.object
-
- DaoSupport
- DatabaseTemplate
- RowMapper
class DaoSupport(__builtin__.object) |
|
Any class that extends this one will be provided with a DatabaseTemplate class
to help carry out database operations. It requires that a connection object be
provided during instantion. |
|
Methods defined here:
- __init__(self, connection_factory=None)
- __setattr__(self, name, value)
- When the connection factory is set, pass it on through to the database template.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class DatabaseTemplate(__builtin__.object) |
|
This class is meant to mimic the Spring framework's JdbcTemplate class.
Since Python doesn't use JDBC, the name is generalized to "Database" |
|
Methods defined here:
- __init__(self, connection_factory=None)
- __setattr__(self, name, value)
- When the connection factory is set, initialize a connection to the database.
- execute(self, sql_statement, args=None)
- Issue a single SQL execute, typically a DDL statement.
- query(self, sql_query, args=None, rowhandler=None)
- Execute a query given static SQL, reading the ResultSet on a per-row basis with a RowMapper.
If args is provided, bind the arguments (to avoid SQL injection attacks).
- query_for_int(self, sql_query, args=None)
- Execute a query that results in an int value, given static SQL. If args is provided, bind the arguments
(to avoid SQL injection attacks).
- query_for_list(self, sql_query, args=None)
- Execute a query for a result list, given static SQL. If args is provided, bind the arguments
(to avoid SQL injection attacks).
- query_for_long(self, sql_query, args=None)
- Execute a query that results in an int value, given static SQL. If args is provided, bind the arguments
(to avoid SQL injection attacks).
- query_for_object(self, sql_query, args=None, required_type=None)
- Execute a query that results in an int value, given static SQL. If args is provided, bind the arguments
(to avoid SQL injection attacks).
- update(self, sql_statement, args=None)
- Issue a single SQL update. If args is provided, bind the arguments
(to avoid SQL injection attacks).
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class RowMapper(__builtin__.object) |
|
This is an interface to handle one row of data. |
|
Methods defined here:
- map_row(self, row)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |