Class ClientDBUtilities


  • public class ClientDBUtilities
    extends AbstractDBUtilities
    These are DB utilities that are common to the client system as a whole (designer, client)
    • Method Detail

      • beginNamedQueryTransaction

        public java.lang.String beginNamedQueryTransaction​(org.python.core.PyObject[] pyArgs,
                                                           java.lang.String[] keywords)
                                                    throws java.lang.Exception
        Throws:
        java.lang.Exception
      • getConnectionInfo

        public Dataset getConnectionInfo()
      • runNamedQuery

        public java.lang.Object runNamedQuery​(org.python.core.PyObject[] values,
                                              java.lang.String[] keywords)
                                       throws java.lang.Exception
        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.
        java.lang.Exception
      • runSFNamedQuery

        public boolean runSFNamedQuery​(org.python.core.PyObject[] pyArgs,
                                       java.lang.String[] keywords)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • clearNamedQueryCache

        public void clearNamedQueryCache​(org.python.core.PyObject[] values,
                                         java.lang.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

        public void clearAllNamedQueryCaches()
                                      throws GatewayException
        Clears all named query caches for the current project.
        Throws:
        GatewayException - if there is an error clearing all the named query caches.
      • _beginTransaction

        protected java.lang.String _beginTransaction​(java.lang.String datasource,
                                                     int isolationLevel,
                                                     long timeout)
                                              throws java.lang.Exception
        Specified by:
        _beginTransaction in class AbstractDBUtilities
        Throws:
        java.lang.Exception
      • _commitTransaction

        protected void _commitTransaction​(java.lang.String txId)
                                   throws java.lang.Exception
        Specified by:
        _commitTransaction in class AbstractDBUtilities
        Throws:
        java.lang.Exception
      • _rollbackTransaction

        protected void _rollbackTransaction​(java.lang.String txId)
                                     throws java.lang.Exception
        Specified by:
        _rollbackTransaction in class AbstractDBUtilities
        Throws:
        java.lang.Exception
      • _closeTransaction

        protected void _closeTransaction​(java.lang.String txId)
                                  throws java.lang.Exception
        Specified by:
        _closeTransaction in class AbstractDBUtilities
        Throws:
        java.lang.Exception
      • _runUpdateQuery

        protected java.lang.Integer _runUpdateQuery​(java.lang.String q,
                                                    java.lang.String datasource,
                                                    java.lang.String txId,
                                                    boolean getIds,
                                                    boolean skipAudit)
                                             throws java.lang.Exception
        Specified by:
        _runUpdateQuery in class AbstractDBUtilities
        Throws:
        java.lang.Exception
      • _runPrepStmt

        protected java.lang.Integer _runPrepStmt​(java.lang.String query,
                                                 java.lang.String datasource,
                                                 java.lang.String txId,
                                                 boolean getIds,
                                                 boolean skipAudit,
                                                 java.lang.Object[] args)
                                          throws java.lang.Exception
        Specified by:
        _runPrepStmt in class AbstractDBUtilities
        Throws:
        java.lang.Exception
      • _runPrepQuery

        protected Dataset _runPrepQuery​(java.lang.String query,
                                        java.lang.String datasource,
                                        java.lang.String txId,
                                        java.lang.Object[] args)
                                 throws java.lang.Exception
        Specified by:
        _runPrepQuery in class AbstractDBUtilities
        Throws:
        java.lang.Exception
      • _runQuery

        protected Dataset _runQuery​(java.lang.String query,
                                    java.lang.String datasource,
                                    java.lang.String txId)
                             throws java.lang.Exception
        Specified by:
        _runQuery in class AbstractDBUtilities
        Throws:
        java.lang.Exception
      • _call

        protected void _call​(SProcCall call)
                      throws java.lang.Exception
        Calls a stored procedure, so safe for client use without permission check.
        Specified by:
        _call in class AbstractDBUtilities
        Throws:
        java.lang.Exception