|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectsky.engine.connector.DatabaseConnector
DatabaseConnector is a layer between SAF Forms and back-end relational database. SAF Forms can contain SQL queries with special tags which are used to automatically map and bind form fields to back-end relational schema. DatabaseConnector serves as the driver for this binding and mapping of form fields to relational schema. An instance of DatabaseConnector contains a handle to a connection pool. Connections are obtained from this connection pool as and when needed. In order for the mapping and binding to take place effectively a SAF based Form must also register itself with the DatabaseConnector. See SAF documentation (http://www.interec.net/SAF) for more details.
$RCSfile: DatabaseConnector.java,v $
$Revision: 1.5 $, $Date: 2005/04/24 03:14:01 $
| Field Summary | |
protected DBConnection |
_conn
Database connection handle |
protected java.lang.String |
_driver
JDBC driver for this connector. |
protected Form |
_form
SAF Form processor that is using this connector. |
protected DBPool |
_pool
Database connection pool handle. |
protected java.util.ArrayList |
_sqls
SQL statements that need to be processed. |
protected java.lang.String |
_url
JDBC URL for this connector. |
| Constructor Summary | |
DatabaseConnector(DBPool pool,
Form form)
Constructor |
|
| Method Summary | |
int |
addQuery(java.lang.String sql)
SAF based forms use this function to register SQL queries containing special tags for binding and mapping of field data to back-end relational schema. |
void |
destroy()
clear all state information. |
DBRowIterator |
executeQuery(int qid)
Execute the SELECT query identified with a specific id. |
int |
executeUpdate(int qid)
Execute an INSERT or UPDATE query |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected DBConnection _conn
protected DBPool _pool
protected java.lang.String _driver
protected java.lang.String _url
protected java.util.ArrayList _sqls
protected Form _form
| Constructor Detail |
public DatabaseConnector(DBPool pool,
Form form)
throws Message
pool - Database connection pool from which a connection will be obtained.form - SAF Form which is going to use this connector.
Messages - in case any connection pool status or error conditions arise.
Message| Method Detail |
public int addQuery(java.lang.String sql)
throws Message
sql - query that may contain SAF query tags.
Message - is there are any error or status conditions to report.
public DBRowIterator executeQuery(int qid)
throws Message
qid - unique id of the query that was previously added.
Message - if there are any error or status messages to report.
public int executeUpdate(int qid)
throws Message
qid - unique id of a query that was previously added.
Message - if there are any error or status conditions.public void destroy()
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||