protected function _i5listTables($schema = null)
    {
        //list of i5 libraries.
        $tables = array();
        if ($schema) {
            $tablesStatement = db2_tables($this->_connection, null, $schema);
            while ($rowTables = db2_fetch_assoc($tablesStatement) ) {
                if ($rowTables['TABLE_NAME'] !== null) {
                    $tables[] = $rowTables['TABLE_NAME'];
                }
            }
        } else {
            $schemaStatement = db2_tables($this->_connection);
            while ($schema = db2_fetch_assoc($schemaStatement)) {
                if ($schema['TABLE_SCHEM'] !== null) {
                    // list of the tables which belongs to the selected library
                    $tablesStatement = db2_tables($this->_connection, NULL, $schema['TABLE_SCHEM']);
                    if (is_resource($tablesStatement)) {
                        while ($rowTables = db2_fetch_assoc($tablesStatement) ) {
                            if ($rowTables['TABLE_NAME'] !== null) {
                                $tables[] = $rowTables['TABLE_NAME'];
                            }
                        }
                    }
                }
            }
        }

        return $tables;
    }