Class DBFResourceAdapter
java.lang.Object
net.simplace.sim.io.FWSimIOAdapter
net.simplace.sim.io.resources.FWSimInputAdapter
net.simplace.sim.io.resources.FWSimResourceAdapter<ResultSet>
net.simplace.sim.io.resources.adapter.DatabaseResourceAdapter
net.simplace.sim.io.resources.adapter.DBFResourceAdapter
- All Implemented Interfaces:
FWSimFieldContainer
Resource adapter for DBF files and the attribute tables of shape files (
DBFInterface). The table is read
via a JDBC connection with SELECT * FROM <table>; everything else works as in
DatabaseResourceAdapter.- Author:
- admin
-
Nested Class Summary
Nested classes/interfaces inherited from class FWSimIOAdapter
FWSimIOAdapter.FREQUENCE -
Field Summary
Fields inherited from class DatabaseResourceAdapter
iLastStatement, iStatementFields inherited from class FWSimResourceAdapter
iLinesToReadFields inherited from class FWSimInputAdapter
iJexlScript, iShouldCacheToDBFields inherited from class FWSimIOAdapter
iArrayMode, iFieldcount, iFrequence, iHeaderVariables, iInterface, iJexlRule, iKeyMap, iName, iOrderNumber, iProcessTime, iResourceElement, iSession, iSourceKey -
Constructor Summary
ConstructorsConstructorDescriptionDBFResourceAdapter(String aPoolName, String aComponentName, int aOrderNumber, FWSimSession aFwSimSession, FWSimIOAdapter.FREQUENCE aFrequence, Map<String, String> aKeyMap, String aDriver, String aUrl, String aUser, String aPass, String aStatement) Creates the adapter from the graph panel, seeDatabaseResourceAdapter(String, String, int, FWSimSession, FREQUENCE, Map, String, String, String, String, String).DBFResourceAdapter(FWSimResourceAdapter<?> aAdapter, DBFInterface aInterface) Copy constructor used when the interface is replaced.DBFResourceAdapter(org.jdom2.Element aResourceElement, FWSimSession aSession, int aOrderNumber) Creates the adapter from aresourceelement of the solution. -
Method Summary
Modifier and TypeMethodDescriptiongetResultSet(FWSimVarMap aVarMap) Reads the whole table of the interface, unless the same statement was executed last time.Methods inherited from class DatabaseResourceAdapter
getData, getStatement, readHeaderList, setStatement, toXMLMethods inherited from class FWSimResourceAdapter
createAdapterFromObservable, createResourceAdapter, getLinesToRead, setLinesToRead, updateAdapterMethods inherited from class FWSimInputAdapter
getContentType, getInputVariables, getJexlScript, getOutputVariables, getVarMap, isTransformer, setFrequenceAndRule, shouldCacheToDB, toHTMLTablestringMethods inherited from class FWSimIOAdapter
addProcessTime, addVariable, checkCondition, createFormFields, createVariables, finalize, getCreateFormXML, getEditFormXML, getFieldMap, getFrequence, getHeaderVariables, getHeaderXML, getInterface, getJexlRule, getKeyMap, getName, getOrderNumber, getVariable, isArrayMode, isConditionCheck, removeVariable, setInterface, setOrderNumber, toString, writeHeaderList
-
Constructor Details
-
DBFResourceAdapter
public DBFResourceAdapter(org.jdom2.Element aResourceElement, FWSimSession aSession, int aOrderNumber) Creates the adapter from aresourceelement of the solution.- Parameters:
aResourceElement- theresourceelementaSession- the sessionaOrderNumber- order number of the adapter
-
DBFResourceAdapter
public DBFResourceAdapter(String aPoolName, String aComponentName, int aOrderNumber, FWSimSession aFwSimSession, FWSimIOAdapter.FREQUENCE aFrequence, Map<String, String> aKeyMap, String aDriver, String aUrl, String aUser, String aPass, String aStatement) throws ExceptionCreates the adapter from the graph panel, seeDatabaseResourceAdapter(String, String, int, FWSimSession, FREQUENCE, Map, String, String, String, String, String).- Parameters:
aPoolName- name of the connection poolaComponentName- name of the adapteraOrderNumber- order number of the adapteraFwSimSession- the sessionaFrequence- frequency the data is read withaKeyMap- key variablesaDriver- JDBC driver classaUrl- JDBC URLaUser- database useraPass- passwordaStatement- SQL statement- Throws:
Exception- if the connection or the header cannot be created
-
DBFResourceAdapter
Copy constructor used when the interface is replaced.- Parameters:
aAdapter- the adapter to copyaInterface- the new interface
-
-
Method Details
-
getResultSet
Reads the whole table of the interface, unless the same statement was executed last time.- Overrides:
getResultSetin classDatabaseResourceAdapter- Parameters:
aVarMap- variable map of the simulation- Returns:
- the result set, or
nullif the table was already read - Throws:
MissingSimResourceException- if the query fails
-