Learn R Programming

RAthena (version 1.7.0)

dbIsValid: Is this DBMS object still valid?

Description

This method tests whether the dbObj is still valid.

Usage

# S4 method for AthenaConnection
dbIsValid(dbObj, ...)

# S4 method for AthenaResult dbIsValid(dbObj, ...)

Arguments

dbObj

An object inheriting from '>DBIObject, i.e. '>DBIDriver, '>DBIConnection, or a '>DBIResult

...

Other arguments to methods.

Value

dbIsValid() returns logical scalar, TRUE if the object (dbObj) is valid, FALSE otherwise.

See Also

dbIsValid

Examples

Run this code
# NOT RUN {
# Note: 
# - Require AWS Account to run below example.
# - Different connection methods can be used please see `RAthena::dbConnect` documnentation

library(DBI)

# Demo connection to Athena using profile name 
con <- dbConnect(RAthena::athena())

# Check is connection is valid
dbIsValid(con)

# Check is query is valid
res <- dbSendQuery(con, "show databases")
dbIsValid(res)

# Check if query is valid after clearing result
dbClearResult(res)
dbIsValid(res)

# Check if connection if valid after closing connection
dbDisconnect(con)
dbIsValid(con)
# }

Run the code above in your browser using DataLab