|
If not dev, correct this wrong version label in perforce3227:3227\buildenvBE.Japro<CODELINE>src_macrospackjavadoc.properties | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sap.aii.mapping.lookup.DataBaseAccessor
public final class DataBaseAccessor
Accessor for data base lookups. Use this accessor to execute SQL queries on a
data base. You get an instance with help of the service LookupService.
| Method Summary | |
|---|---|
void |
close()
Closes this accessor and releases any resources associated with the accessor. |
DataBaseResult |
execute(String sqlStatement)
Queries a data base by the given SQL statement. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public DataBaseResult execute(String sqlStatement)
throws LookupException
close().
Note: The SQL statement is packed into an XML during the processing.
Therefore the reserved XML markup characters '&', '"', '<', '>',
and ''' are escaped to "&", """, "<", ">",
and "'"; exception: If the given SQL statement does
already contain the escaped character sequences "&", """, "<", ">",
or "'" then the character '&' is not
escaped in these character sequences. During the parsing of the XML a
unescaping is executed. Therefore, for example, if you want to query for
data-base table entries containing in the column A the character sequence "&",
then you have to use the following where condition in the SQL statement:
where A ='&amp;'.
The accessor does not support transactional behaviour. Therefore, the method should not be used to execute insert or update statements on the data base which can lead to inconsistencies. The accessor should only be used to read data from a data base table.
sqlStatement - SQL statement
LookupException - if an error occurs.
NullPointerException - if sqlStatement is null.
public void close()
throws LookupException
The method must be called using the secure cleanup idiom:
DataAccessor accessor = Service.getDataAccessor(aChannel);
try{
DataBaseResult resultSet = accessor.execute("SELECT a, b, c FROM TABLE2");
}finally{
for(Iterator rows = resultSet.getRows();rows.hasNext();){
// Operate on the rows provided by the database
}
Map rowMap = (Map)rows.next();
Object aValue = rowMap.get("a");
Object bValue = rowMap.get("b");
Object cValue = rowMap.get("c");
...
if (accessor!=null) accessor.close();
}
LookupException - if an error occurs.
|
If not dev, correct this wrong version label in perforce3227:3227\buildenvBE.Japro<CODELINE>src_macrospackjavadoc.properties | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||