|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnl.gx.webmanager.handler.forms.foundation.FormHandlerBase
public abstract class FormHandlerBase
Convenient base class for handlers. FIXME: add a generic insert with identity method that uses the oracle & mssql specific methods. FIXME: move database methods to a separate database utility class, update all handlers and provide deprecated stubs in this class. Database class may be useful for api as well.
| Field Summary | |
|---|---|
static int |
DEFAULT_STATEMENT_TIMEOUT
|
protected java.util.logging.Logger |
log
|
protected static java.util.logging.Logger |
staticlog
|
| Constructor Summary | |
|---|---|
FormHandlerBase()
|
|
| Method Summary | |
|---|---|
static void |
close(java.sql.ResultSet rs,
java.sql.Connection con)
Utility method to close a resultset and a connection safely. |
static void |
close(java.sql.ResultSet rs,
java.sql.Statement statement,
java.sql.Connection con)
Utility method to close a resultset, statement and connection safely. |
static void |
close(java.sql.Statement statement,
java.sql.Connection con)
Utility method to close a statement and a connection safely. |
protected static java.lang.String |
executeInsertWithIdentityMSSQLMYSQL(javax.sql.DataSource datasource,
java.lang.String statement)
Insert a row into a mssql or mysql table and return the incremented id of the row. |
protected static java.lang.String |
executeInsertWithIdentityOracle(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.String tablename,
java.lang.String identityfield)
For oracle we first increment a sequence and then use new id in the insert statement. |
static java.lang.Integer |
executeIntegerQuery(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Class[] types,
java.lang.Object[] arguments)
Execute a query that returns an integer (for example a select will return the number of records. |
static java.lang.Integer |
executeIntegerQuery(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Object[] arguments)
Execute a query that returns an integer (for example a select will return the number of records. |
static java.lang.Integer[] |
executeIntegersQuery(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Class[] types,
java.lang.Object[] arguments)
Execute a query that returns integers. |
static java.lang.Integer[] |
executeIntegersQuery(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Object[] arguments)
Execute a query that returns integers. |
protected static java.lang.Object[][] |
executeQuery(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Object[] arguments)
Executes a select statement on a datasource. |
protected static java.lang.String[] |
executeStringQuery(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Object[] arguments)
|
protected static int |
executeUpdate(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Object[] arguments,
java.lang.Class[] classes)
|
static void |
fillValues(FormPart[] webUserParts,
SessionFormFlow formValues,
java.lang.Class[] classes,
java.lang.Object[] args)
Fill the class and args parameter for use in a query (for example executeIntegerQuery). |
static javax.sql.DataSource |
getDataSource(java.lang.String connectionName)
|
protected static void |
setArguments(java.sql.PreparedStatement stmt,
java.lang.Object[] objects,
java.lang.Class[] classes)
|
protected static void |
setArguments(java.sql.PreparedStatement stmt,
java.lang.Object[] objects,
int[] types)
Set the parameters of a query to the values. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface nl.gx.webmanager.handler.forms.FormComponent |
|---|
init |
| Field Detail |
|---|
protected static final java.util.logging.Logger staticlog
protected java.util.logging.Logger log
public static final int DEFAULT_STATEMENT_TIMEOUT
| Constructor Detail |
|---|
public FormHandlerBase()
| Method Detail |
|---|
public static javax.sql.DataSource getDataSource(java.lang.String connectionName)
throws java.sql.SQLException
java.sql.SQLException
protected static void setArguments(java.sql.PreparedStatement stmt,
java.lang.Object[] objects,
int[] types)
throws java.sql.SQLException
stmt - the statement to set the values onobjects - an array with the valuestypes - an array with the java.sql.Types
java.sql.SQLException
protected static void setArguments(java.sql.PreparedStatement stmt,
java.lang.Object[] objects,
java.lang.Class[] classes)
throws java.sql.SQLException
java.sql.SQLException
protected static int executeUpdate(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Object[] arguments,
java.lang.Class[] classes)
throws java.sql.SQLException
java.sql.SQLException
protected static java.lang.Object[][] executeQuery(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Object[] arguments)
throws java.sql.SQLException
datasource - The datasource for the statementstatement - The select statement that should be executedarguments - The arguments for the prepared statement.
null if there are no tuples available.
java.sql.SQLException - If the statement couldn't be executed
public static java.lang.Integer executeIntegerQuery(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Object[] arguments)
throws java.sql.SQLException
datasource - statement - arguments -
java.sql.SQLException
public static java.lang.Integer executeIntegerQuery(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Class[] types,
java.lang.Object[] arguments)
throws java.sql.SQLException
datasource - statement - types - arguments -
java.sql.SQLException
public static java.lang.Integer[] executeIntegersQuery(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Object[] arguments)
throws java.sql.SQLException
datasource - statement - arguments -
java.sql.SQLException
public static java.lang.Integer[] executeIntegersQuery(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Class[] types,
java.lang.Object[] arguments)
throws java.sql.SQLException
datasource - statement - types - arguments -
java.sql.SQLException
protected static java.lang.String[] executeStringQuery(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.Object[] arguments)
throws java.sql.SQLException
java.sql.SQLException
protected static java.lang.String executeInsertWithIdentityOracle(javax.sql.DataSource datasource,
java.lang.String statement,
java.lang.String tablename,
java.lang.String identityfield)
throws java.sql.SQLException
datasource - statement - tablename - identityfield -
java.sql.SQLException
protected static java.lang.String executeInsertWithIdentityMSSQLMYSQL(javax.sql.DataSource datasource,
java.lang.String statement)
throws java.sql.SQLException
datasource - statement -
java.sql.SQLException
public static void close(java.sql.ResultSet rs,
java.sql.Statement statement,
java.sql.Connection con)
throws java.sql.SQLException
rs - statement - con -
java.sql.SQLException
public static void close(java.sql.Statement statement,
java.sql.Connection con)
throws java.sql.SQLException
statement - con -
java.sql.SQLException
public static void close(java.sql.ResultSet rs,
java.sql.Connection con)
throws java.sql.SQLException
rs - con -
java.sql.SQLException
public static void fillValues(FormPart[] webUserParts,
SessionFormFlow formValues,
java.lang.Class[] classes,
java.lang.Object[] args)
webUserParts - formparts with valuesformValues - the formflow with the form valuesclasses - this array will be filled with the types of the formvaluesargs - this array will be filled with instances of the types with the appropriate values
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||