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
_clearAllQueryCaches
(String projectName) protected void
_clearQueryCache
(String project, Set<String> path) protected void
_closeTransaction
(String txId) protected void
_commitTransaction
(String txId) protected Object
_execNamedQuery
(String projectName, String path, Map<String, Object> parameters, String tx, boolean getKey) protected boolean
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 query, String datasource, String txId, boolean getIds, boolean skipAudit) beginNamedQueryTransaction
(org.python.core.PyObject[] pyArgs, String[] keywords) void
Deprecated.void
clearNamedQueryCache
(org.python.core.PyObject[] values, String[] keywords) Deprecated.As of 8.3.0, useAbstractDBUtilities.clearQueryCache(org.python.core.PyObject[], java.lang.String[])
instead.protected List<RpcDatasourceMeta>
getQueryParameters
(String project, String queryPath) runNamedQuery
(org.python.core.PyObject[] values, String[] keywords) Deprecated.boolean
runSFNamedQuery
(org.python.core.PyObject[] pyArgs, String[] keywords) Deprecated.As of 8.3.0, useAbstractDBUtilities.execUpdateAsync(org.python.core.PyObject[], java.lang.String[])
instead.Methods inherited from class com.inductiveautomation.ignition.common.script.builtin.AbstractDBUtilities
beginTransaction, clearQueryCache, closeTransaction, commitTransaction, createSProcCall, dataSetToCSV, dateFormat, error, execQuery, execSProcCall, execUpdate, execUpdateAsync, extractParameters, extractPath, extractProject, 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
@Deprecated(since="8.3.0") public Object runNamedQuery(org.python.core.PyObject[] values, String[] keywords) throws Exception Deprecated.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
-
getDefaultProject
- Specified by:
getDefaultProject
in classAbstractDBUtilities
-
_execNamedQuery
protected Object _execNamedQuery(String projectName, String path, Map<String, Object> parameters, String tx, boolean getKey) throws Exception- Specified by:
_execNamedQuery
in classAbstractDBUtilities
- Throws:
Exception
-
getQueryParameters
- Specified by:
getQueryParameters
in classAbstractDBUtilities
-
runSFNamedQuery
@Deprecated(since="8.3.0") public boolean runSFNamedQuery(org.python.core.PyObject[] pyArgs, String[] keywords) throws Exception Deprecated.As of 8.3.0, useAbstractDBUtilities.execUpdateAsync(org.python.core.PyObject[], java.lang.String[])
instead.- Throws:
Exception
-
_execNamedQueryAsync
protected boolean _execNamedQueryAsync(String projectName, String path, Map<String, Object> parameters) throws Exception- Specified by:
_execNamedQueryAsync
in classAbstractDBUtilities
- Throws:
Exception
-
clearNamedQueryCache
@Deprecated(since="8.3.0") public void clearNamedQueryCache(org.python.core.PyObject[] values, String[] keywords) throws GatewayException Deprecated.As of 8.3.0, useAbstractDBUtilities.clearQueryCache(org.python.core.PyObject[], java.lang.String[])
instead.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.
-
_clearQueryCache
- Specified by:
_clearQueryCache
in classAbstractDBUtilities
- Throws:
GatewayException
-
clearAllNamedQueryCaches
Deprecated.As of 8.3.0, useAbstractDBUtilities.clearQueryCache(org.python.core.PyObject[], java.lang.String[])
instead.Clears all named query caches for the current project.- Throws:
GatewayException
- if there is an error clearing all the named query caches.
-
_clearAllQueryCaches
- Specified by:
_clearAllQueryCaches
in classAbstractDBUtilities
- Throws:
GatewayException
-
_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 query, 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
-
AbstractDBUtilities.clearQueryCache(org.python.core.PyObject[], java.lang.String[])
instead.