Class ClientDBUtilities
java.lang.Object
com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities
com.inductiveautomation.ignition.client.script.ClientDBUtilities
These are DB utilities that are common to the client system as a whole (designer, client)
-
Field Summary
FieldsFields inherited from class com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities
ARRAY, BIGINT, BINARY, BIT, BLOB, BOOLEAN, CHAR, CLOB, DATALINK, DATE, DECIMAL, DISTINCT, DOUBLE, FLOAT, INTEGER, JAVA_OBJECT, LONGNVARCHAR, LONGVARBINARY, LONGVARCHAR, NCHAR, NCLOB, NULL, NUMERIC, NVARCHAR, ORACLE_CURSOR, OTHER, READ_COMMITTED, READ_UNCOMMITTED, REAL, REF, REPEATABLE_READ, ROWID, SDF_THREAD_LOCAL, SERIALIZABLE, SMALLINT, SQLXML, STRUCT, TIME, TIMESTAMP, TINYINT, VARBINARY, VARCHAR
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected String
_beginTransaction
(String datasource, int isolationLevel, long timeout) protected void
Calls a stored procedure, so safe for client use without permission check.protected void
_closeTransaction
(String txId) protected void
_commitTransaction
(String txId) protected List<? extends DatasourceMeta>
protected String
_getDatasourceName
(String txId) protected void
_rollbackTransaction
(String txId) protected Dataset
_runPrepQuery
(String query, String datasource, String txId, Object[] args) protected Integer
_runPrepStmt
(String query, String datasource, String txId, boolean getIds, boolean skipAudit, Object[] args) protected Dataset
protected Integer
_runUpdateQuery
(String q, String datasource, String txId, boolean getIds, boolean skipAudit) beginNamedQueryTransaction
(org.python.core.PyObject[] pyArgs, String[] keywords) void
Clears all named query caches for the current project.void
clearNamedQueryCache
(org.python.core.PyObject[] values, String[] keywords) Clears the cache of the named query specified by the path parameter.runNamedQuery
(org.python.core.PyObject[] values, String[] keywords) This invokes the gateway rpc, which only uses the saved query version.boolean
runSFNamedQuery
(org.python.core.PyObject[] pyArgs, String[] keywords) Methods inherited from class com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities
beginTransaction, closeTransaction, commitTransaction, createSProcCall, dataSetToCSV, dateFormat, error, execSProcCall, getConnectionInfo, getConnections, getDatasource, getTransactionDatasource, rollbackTransaction, runPrepQuery, runPrepStmt, runPrepStmt, runPrepStmtGetKey, runPrepStmtGetKey, runPrepUpdate, runQuery, runScalarPrepQuery, runScalarQuery, runUpdateQuery, runUpdateQueryGetKey, runUpdateQueryGetKey, toDataset, toDataSet, toDataSet, toPyDataSet
-
Field Details
-
context
-
-
Constructor Details
-
ClientDBUtilities
-
-
Method Details
-
beginNamedQueryTransaction
public String beginNamedQueryTransaction(org.python.core.PyObject[] pyArgs, String[] keywords) throws Exception - Throws:
Exception
-
getConnectionInfo
-
runNamedQuery
This invokes the gateway rpc, which only uses the saved query version. Named queries are "safe", so does not need the ClientProtection annotation.- Returns:
- Results of the query. May be null or empty if the query failed or returned no results.
- Throws:
GatewayException
- If path is invalid or query can't be run.Exception
-
runSFNamedQuery
public boolean runSFNamedQuery(org.python.core.PyObject[] pyArgs, String[] keywords) throws Exception - Throws:
Exception
-
clearNamedQueryCache
public void clearNamedQueryCache(org.python.core.PyObject[] values, String[] keywords) throws GatewayException Clears the cache of the named query specified by the path parameter. Will use published version. May not be null.- Throws:
GatewayException
- if the path is malformed.
-
clearAllNamedQueryCaches
Clears all named query caches for the current project.- Throws:
GatewayException
- if there is an error clearing all the named query caches.
-
_beginTransaction
protected String _beginTransaction(String datasource, int isolationLevel, long timeout) throws Exception - Specified by:
_beginTransaction
in classAbstractDBUtilities
- Throws:
Exception
-
_commitTransaction
- Specified by:
_commitTransaction
in classAbstractDBUtilities
- Throws:
Exception
-
_rollbackTransaction
- Specified by:
_rollbackTransaction
in classAbstractDBUtilities
- Throws:
Exception
-
_closeTransaction
- Specified by:
_closeTransaction
in classAbstractDBUtilities
- Throws:
Exception
-
_getDatasourceName
- Specified by:
_getDatasourceName
in classAbstractDBUtilities
- Throws:
Exception
-
_runUpdateQuery
protected Integer _runUpdateQuery(String q, String datasource, String txId, boolean getIds, boolean skipAudit) throws Exception - Specified by:
_runUpdateQuery
in classAbstractDBUtilities
- Throws:
Exception
-
_runPrepStmt
protected Integer _runPrepStmt(String query, String datasource, String txId, boolean getIds, boolean skipAudit, Object[] args) throws Exception - Specified by:
_runPrepStmt
in classAbstractDBUtilities
- Throws:
Exception
-
_runPrepQuery
protected Dataset _runPrepQuery(String query, String datasource, String txId, Object[] args) throws Exception - Specified by:
_runPrepQuery
in classAbstractDBUtilities
- Throws:
Exception
-
_runQuery
- Specified by:
_runQuery
in classAbstractDBUtilities
- Throws:
Exception
-
_findDatasources
- Specified by:
_findDatasources
in classAbstractDBUtilities
-
_call
Calls a stored procedure, so safe for client use without permission check.- Specified by:
_call
in classAbstractDBUtilities
- Throws:
Exception
-