Class MariaDbFunctionStatement

    • Constructor Detail

      • MariaDbFunctionStatement

        public MariaDbFunctionStatement​(MariaDbConnection connection,
                                        java.lang.String databaseName,
                                        java.lang.String functionName,
                                        java.lang.String arguments,
                                        int resultSetType,
                                        int resultSetConcurrency,
                                        ExceptionFactory exceptionFactory)
                                 throws java.sql.SQLException
        Specific implementation of CallableStatement to handle function call, represent by call like {?= call procedure-name[(arg1,arg2, ...)]}.
        Parameters:
        connection - current connection
        databaseName - database name
        functionName - function name
        arguments - function args
        resultSetType - a result set type; one of ResultSet.TYPE_FORWARD_ONLY, ResultSet.TYPE_SCROLL_INSENSITIVE, or ResultSet.TYPE_SCROLL_SENSITIVE
        resultSetConcurrency - a concurrency type; one of ResultSet.CONCUR_READ_ONLY or ResultSet.CONCUR_UPDATABLE
        exceptionFactory - Exception factory
        Throws:
        java.sql.SQLException - exception
    • Method Detail

      • executeUpdate

        public int executeUpdate()
                          throws java.sql.SQLException
        Executes the CALL statement.
        Specified by:
        executeUpdate in interface java.sql.PreparedStatement
        Overrides:
        executeUpdate in class ClientSidePreparedStatement
        Returns:
        either (1) the row count for SQL Data Manipulation Language (DML) statements or (2) 0 for SQL statements that return nothing
        Throws:
        java.sql.SQLException - if a database access error occurs; this method is called on a closed PreparedStatement or the SQL statement returns a ResultSet object
      • retrieveOutputResult

        private void retrieveOutputResult()
                                   throws java.sql.SQLException
        Throws:
        java.sql.SQLException
      • setParameter

        public void setParameter​(int parameterIndex,
                                 ParameterHolder holder)
                          throws java.sql.SQLException
        Description copied from class: ClientSidePreparedStatement
        Set parameter.
        Overrides:
        setParameter in class ClientSidePreparedStatement
        Parameters:
        parameterIndex - index
        holder - parameter holder
        Throws:
        java.sql.SQLException - if index position doesn't correspond to query parameters
      • executeQuery

        public java.sql.ResultSet executeQuery()
                                        throws java.sql.SQLException
        Description copied from class: ClientSidePreparedStatement
        Executes the SQL query in this PreparedStatement object and returns the ResultSet object generated by the query.
        Specified by:
        executeQuery in interface java.sql.PreparedStatement
        Overrides:
        executeQuery in class ClientSidePreparedStatement
        Returns:
        a ResultSet object that contains the data produced by the query; never null
        Throws:
        java.sql.SQLException - if a database access error occurs; this method is called on a closed PreparedStatement or the SQL statement does not return a ResultSet object
      • execute

        public boolean execute()
                        throws java.sql.SQLException
        Description copied from class: ClientSidePreparedStatement
        Executes the SQL statement in this PreparedStatement object, which may be any kind of SQL statement. Some prepared statements return multiple results; the execute method handles these complex statements as well as the simpler form of statements handled by the methods executeQuery and executeUpdate.
        The execute method returns a boolean to indicate the form of the first result. You must call either the method getResultSet or getUpdateCount to retrieve the result; you must call getInternalMoreResults to move to any subsequent result(s).
        Specified by:
        execute in interface java.sql.PreparedStatement
        Overrides:
        execute in class ClientSidePreparedStatement
        Returns:
        true if the first result is a ResultSet object; false if the first result is an update count or there is no result
        Throws:
        java.sql.SQLException - if a database access error occurs; this method is called on a closed PreparedStatement or an argument is supplied to this method
        See Also:
        Statement.execute(java.lang.String), Statement.getResultSet(), Statement.getUpdateCount(), Statement.getMoreResults()