Interface Database

    • Method Detail

      • getJdbcUrl

        String getJdbcUrl()
        Get the value for JdbcUrl. (The jdbc url to the database) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getJdbcUserName

        String getJdbcUserName()
        Get the value for JdbcUserName. (The jdbc user name for the database used to check connections are valid.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getJdbcDriverClassName

        String getJdbcDriverClassName()
        Get the value for JdbcDriverClassName. (The driver class to use) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getDriverProperties

        String getDriverProperties()
        Get the value for DriverProperties. (The optional driver properties, they must be passed in as property=value, each one on a new line.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getInitializationQuery

        String getInitializationQuery()
        Get the value for InitializationQuery. (The optional initialization query that is executed when a connection is opened.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getValidationQuery

        String getValidationQuery()
        Get the value for ValidationQuery. (The optional validation query that is executed to see if a connection is valid, before it is returned to the caller.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getPoolingState

        JdbcConnectionPoolingState getPoolingState()
        Get the value for PoolingState. (The pooling state to use.) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getFrequentUsers

        String getFrequentUsers()
        Get the value for FrequentUsers. (You can optionally specify frequent users separated by a comma.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getMaxAbandonedTime

        Long getMaxAbandonedTime()
        Get the value for MaxAbandonedTime. (The optional value to specify the maximum time before an open, unused connection, is abandoned. Time is in milliseconds.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getMaxConnectTime

        Long getMaxConnectTime()
        Get the value for MaxConnectTime. (The optional value to specify the maximum time to connect (open a connection) before this fails. Time is in milliseconds.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getMaxIdleTime

        Long getMaxIdleTime()
        Get the value for MaxIdleTime. (The optional value to specify the maximum time a connection is allowed to idle (remains in the pool, but no-one requests it). Time is in milliseconds.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getMaxNumberOfConnections

        Long getMaxNumberOfConnections()
        Get the value for MaxNumberOfConnections. (The optional value to specify the maximum number of connections for the pool.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getMaxNumberOfConnectionsPerFrequentUser

        Long getMaxNumberOfConnectionsPerFrequentUser()
        Get the value for MaxNumberOfConnectionsPerFrequentUser. (The optional value to specify the maximum number of connections to use for the frequent users.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getMaxNumberOfConnectionsPerSporadicUser

        Long getMaxNumberOfConnectionsPerSporadicUser()
        Get the value for MaxNumberOfConnectionsPerSporadicUser. (The optional value to specify the maximum number of connections to use for sporadic users.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getMinNumberOfIdleConnectionsPerFrequentUser

        Long getMinNumberOfIdleConnectionsPerFrequentUser()
        Get the value for MinNumberOfIdleConnectionsPerFrequentUser. (The optional value to specify the minimum of idle connections to be available to use for the frequent users.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getSevereSQLExceptions

        String getSevereSQLExceptions()
        Get the value for SevereSQLExceptions. (Optionally specify severe error codes and/or error states that can occur in your database, separated by comma. If these occur for your database they will be treated as fatal exceptions. Please only set when Redwood Support asks you to.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getNonTransientConnectSQLExceptions

        String getNonTransientConnectSQLExceptions()
        Get the value for NonTransientConnectSQLExceptions. (Optionally specify non-transient error codes and/or error states that can occur in your database, separated by comma. If these occur during e.g. queries, they are treated as non-transient and will not be repeated (the statement will fail). Please only set when Redwood Support asks you to.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getInvalidUserNameOrPasswordSQLExceptions

        String getInvalidUserNameOrPasswordSQLExceptions()
        Get the value for InvalidUserNameOrPasswordSQLExceptions. (Optionally specify error codes and/or error states that can occur in your database when a login to is is incorrect, separated by comma. If these occur for your database they will be treated as login failure exceptions.)
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getAutoCommitStyle

        AutoCommitStyle getAutoCommitStyle()
        Get the value for AutoCommitStyle. (Enable or Disable the default setting for auto commit the database connection. Default auto commit is set to Transaction Based, which means that a commit is done at the end of the job.) This value is mandatory, and therefore will not be null if this object has been retrieved from the database.
        Returns:
        the field
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setJdbcUrl

        void setJdbcUrl​(String newJdbcUrl)
        Set the value for JdbcUrl. (The jdbc url to the database) This value is mandatory.
        Parameters:
        newJdbcUrl - the new value for JdbcUrl. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setJdbcUserName

        void setJdbcUserName​(String newJdbcUserName)
        Set the value for JdbcUserName. (The jdbc user name for the database used to check connections are valid.) This value is optional.
        Parameters:
        newJdbcUserName - the new value for JdbcUserName.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setJdbcDriverClassName

        void setJdbcDriverClassName​(String newJdbcDriverClassName)
        Set the value for JdbcDriverClassName. (The driver class to use) This value is mandatory.
        Parameters:
        newJdbcDriverClassName - the new value for JdbcDriverClassName. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setDriverProperties

        void setDriverProperties​(String newDriverProperties)
        Set the value for DriverProperties. (The optional driver properties, they must be passed in as property=value, each one on a new line.) This value is optional.
        Parameters:
        newDriverProperties - the new value for DriverProperties.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setInitializationQuery

        void setInitializationQuery​(String newInitializationQuery)
        Set the value for InitializationQuery. (The optional initialization query that is executed when a connection is opened.) This value is optional.
        Parameters:
        newInitializationQuery - the new value for InitializationQuery.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setValidationQuery

        void setValidationQuery​(String newValidationQuery)
        Set the value for ValidationQuery. (The optional validation query that is executed to see if a connection is valid, before it is returned to the caller.) This value is optional.
        Parameters:
        newValidationQuery - the new value for ValidationQuery.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setPoolingState

        void setPoolingState​(JdbcConnectionPoolingState newPoolingState)
        Set the value for PoolingState. (The pooling state to use.) This value is mandatory.
        Parameters:
        newPoolingState - the new value for PoolingState. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setFrequentUsers

        void setFrequentUsers​(String newFrequentUsers)
        Set the value for FrequentUsers. (You can optionally specify frequent users separated by a comma.) This value is optional.
        Parameters:
        newFrequentUsers - the new value for FrequentUsers.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setMaxAbandonedTime

        void setMaxAbandonedTime​(Long newMaxAbandonedTime)
        Set the value for MaxAbandonedTime. (The optional value to specify the maximum time before an open, unused connection, is abandoned. Time is in milliseconds.) This value is optional.
        Parameters:
        newMaxAbandonedTime - the new value for MaxAbandonedTime.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setMaxConnectTime

        void setMaxConnectTime​(Long newMaxConnectTime)
        Set the value for MaxConnectTime. (The optional value to specify the maximum time to connect (open a connection) before this fails. Time is in milliseconds.) This value is optional.
        Parameters:
        newMaxConnectTime - the new value for MaxConnectTime.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setMaxIdleTime

        void setMaxIdleTime​(Long newMaxIdleTime)
        Set the value for MaxIdleTime. (The optional value to specify the maximum time a connection is allowed to idle (remains in the pool, but no-one requests it). Time is in milliseconds.) This value is optional.
        Parameters:
        newMaxIdleTime - the new value for MaxIdleTime.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setMaxNumberOfConnections

        void setMaxNumberOfConnections​(Long newMaxNumberOfConnections)
        Set the value for MaxNumberOfConnections. (The optional value to specify the maximum number of connections for the pool.) This value is optional.
        Parameters:
        newMaxNumberOfConnections - the new value for MaxNumberOfConnections.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setMaxNumberOfConnectionsPerFrequentUser

        void setMaxNumberOfConnectionsPerFrequentUser​(Long newMaxNumberOfConnectionsPerFrequentUser)
        Set the value for MaxNumberOfConnectionsPerFrequentUser. (The optional value to specify the maximum number of connections to use for the frequent users.) This value is optional.
        Parameters:
        newMaxNumberOfConnectionsPerFrequentUser - the new value for MaxNumberOfConnectionsPerFrequentUser.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setMaxNumberOfConnectionsPerSporadicUser

        void setMaxNumberOfConnectionsPerSporadicUser​(Long newMaxNumberOfConnectionsPerSporadicUser)
        Set the value for MaxNumberOfConnectionsPerSporadicUser. (The optional value to specify the maximum number of connections to use for sporadic users.) This value is optional.
        Parameters:
        newMaxNumberOfConnectionsPerSporadicUser - the new value for MaxNumberOfConnectionsPerSporadicUser.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setMinNumberOfIdleConnectionsPerFrequentUser

        void setMinNumberOfIdleConnectionsPerFrequentUser​(Long newMinNumberOfIdleConnectionsPerFrequentUser)
        Set the value for MinNumberOfIdleConnectionsPerFrequentUser. (The optional value to specify the minimum of idle connections to be available to use for the frequent users.) This value is optional.
        Parameters:
        newMinNumberOfIdleConnectionsPerFrequentUser - the new value for MinNumberOfIdleConnectionsPerFrequentUser.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setSevereSQLExceptions

        void setSevereSQLExceptions​(String newSevereSQLExceptions)
        Set the value for SevereSQLExceptions. (Optionally specify severe error codes and/or error states that can occur in your database, separated by comma. If these occur for your database they will be treated as fatal exceptions. Please only set when Redwood Support asks you to.) This value is optional.
        Parameters:
        newSevereSQLExceptions - the new value for SevereSQLExceptions.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setNonTransientConnectSQLExceptions

        void setNonTransientConnectSQLExceptions​(String newNonTransientConnectSQLExceptions)
        Set the value for NonTransientConnectSQLExceptions. (Optionally specify non-transient error codes and/or error states that can occur in your database, separated by comma. If these occur during e.g. queries, they are treated as non-transient and will not be repeated (the statement will fail). Please only set when Redwood Support asks you to.) This value is optional.
        Parameters:
        newNonTransientConnectSQLExceptions - the new value for NonTransientConnectSQLExceptions.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setInvalidUserNameOrPasswordSQLExceptions

        void setInvalidUserNameOrPasswordSQLExceptions​(String newInvalidUserNameOrPasswordSQLExceptions)
        Set the value for InvalidUserNameOrPasswordSQLExceptions. (Optionally specify error codes and/or error states that can occur in your database when a login to is is incorrect, separated by comma. If these occur for your database they will be treated as login failure exceptions.) This value is optional.
        Parameters:
        newInvalidUserNameOrPasswordSQLExceptions - the new value for InvalidUserNameOrPasswordSQLExceptions.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • setAutoCommitStyle

        void setAutoCommitStyle​(AutoCommitStyle newAutoCommitStyle)
        Set the value for AutoCommitStyle. (Enable or Disable the default setting for auto commit the database connection. Default auto commit is set to Transaction Based, which means that a commit is done at the end of the job.) This value is mandatory.
        Parameters:
        newAutoCommitStyle - the new value for AutoCommitStyle. If this is null, then the object cannot be persisted.
        Throws:
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - This will be thrown if this method is called while the object is not attached to a session.
      • getFrequentUsersAsList

        List<String> getFrequentUsersAsList()
        Return the frequent users, if any, as List<String>. If none are present returns an empty list.
        Returns:
        Return a List<String> of frequent users, empty List if none.
      • getDriverProperiesAsProperties

        Properties getDriverProperiesAsProperties()
        Return the driver properties, if any, as Properties object. If none are present returns an empty Properties object.
        Returns:
        Return a Properties object for the driver properties, if any. Empty Properties object otherwise.
      • connect

        DatabaseConnection connect​(Credential credential)
                            throws SQLException,
                                   com.redwood.scheduler.api.exception.LicenseException
        Connect to the database using a credential.
        Parameters:
        credential - The (JDBC) credentials to use to connect to the database.
        Returns:
        A database connection.
        Throws:
        SQLException
        com.redwood.scheduler.api.exception.LicenseException - License violation.
        See Also:
        for an example
      • createDatabaseConnectionBuilder

        DatabaseConnectionBuilder createDatabaseConnectionBuilder()
                                                           throws SQLException,
                                                                  com.redwood.scheduler.api.exception.LicenseException
        Create a DatabaseConnectionBuilder for this database.
        Returns:
        A DatabaseConnectionBuilder, which can be used to eventually create a DatabaseConnection, but with the option to specify some options first.
        Throws:
        SQLException
        com.redwood.scheduler.api.exception.LicenseException - License violation.
        See Also:
        for an example
      • from

        static Database from​(ProcessServer processServer)
        Return Database from ProcessServer. Helper to get to database attached to process server
        Parameters:
        processServer - The process server to retrieve database from.
        Returns:
        Get database from process server, can return null.
      • getLibrary

        Library getLibrary()
        Get the Library.
        Returns:
        Library
        Throws:
        com.redwood.scheduler.api.exception.ObjectDeletedException - If this method is called when the object has been marked for deletion.
        com.redwood.scheduler.api.exception.ObjectNotAttachedToSessionException - If this method is called when the object has been removed from it's session.
      • setLibrary

        void setLibrary​(Library newLibrary)
        Set the value for Library. This value is optional.
        Parameters:
        newLibrary - is the object to set Library to. The library that the Database object uses to locate the driver in.
      • checkCreatePrivilege

        RequiredPermission checkCreatePrivilege()
        Check whether or not the create action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkViewPrivilege

        RequiredPermission checkViewPrivilege()
        Check whether or not the view action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkEditPrivilege

        RequiredPermission checkEditPrivilege()
        Check whether or not the edit action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.
      • checkDeletePrivilege

        RequiredPermission checkDeletePrivilege()
        Check whether or not the delete action can be performed on this object.
        Returns:
        a RequiredPermission instance indicating whether the current user has the privilege. To check this, use isAllowed() on the returned permission.