|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.dhmp.io.MapSQLStatement
Handle SQL statements. It is similar to CallableStatement
but convert result set to HierarchicalMap. It also
accepts parameters in HierarchicalMap format.
Start instantiating this class passing Connection.
Then set a statement, or a callable
statement like "{ call procedure(?, ?, ?) }".
Create a HierarchicalMap containing input parameters.
When parameter is output or inout, it must
be wrapped using either OutParameter or InOutParameter classes.
This class is not thread safe. Be aware
when sharing the same connection among several
MapSQLStatement.
Nested Class Summary | |
static class |
MapSQLStatement.InOutParameter
Static class to flag a node to be registered as in/out parameter. |
static class |
MapSQLStatement.OutParameter
Static class to flag a node to be registered as out parameter. |
static class |
MapSQLStatement.OutResultSet
Static class to flag a node to be registered as out ResultSet. |
static class |
MapSQLStatement.Parameter
A parent class for Parameters. |
Field Summary | |
static MapSQLStatement.OutResultSet |
ResultSet
|
Constructor Summary | |
MapSQLStatement(java.sql.Connection con)
Constructor receiving a connection to be used for further SQL statement execution. |
Method Summary | |
void |
close()
Closes the current connection. |
HierarchicalMap |
execute()
Executes the statement without parameter. |
HierarchicalMap |
execute(HierarchicalMap param)
Executes the statement using HierarchiclMap as parameter. |
java.lang.String |
getResultSetName()
Retrieves the current resultsetname. |
java.sql.CallableStatement |
getStatement()
Retrieve the statement object. |
void |
setResultSetName(java.lang.String resultsetname)
Defines the prefix for key used to map resultsets. |
void |
setStatement(java.lang.String sql)
Prepares a callable statement object to be used during execution. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final MapSQLStatement.OutResultSet ResultSet
Constructor Detail |
public MapSQLStatement(java.sql.Connection con)
con
- a java.sql.Connection object.Method Detail |
public void setStatement(java.lang.String sql)
sql
- an SQL statement that may contain several '?' as in or out parameter placeholders.public java.sql.CallableStatement getStatement()
public HierarchicalMap execute()
public HierarchicalMap execute(HierarchicalMap param)
param
- HierarchicalMap containing parameters.
public void setResultSetName(java.lang.String resultsetname)
resultsetname
- to be used for further execution.public java.lang.String getResultSetName()
public void close()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |