db.disconnect: Disconnect a connection to a database

Description Usage Arguments Value Author(s) See Also Examples

View source: R/db_conn-generic.R

Description

Although all the database connections will be automatically closed when this package is unloaded, one can choose to disconnect a database connection himself.

Usage

1
db.disconnect(conn.id = 1, verbose = TRUE, force = FALSE)

Arguments

conn.id

An integer, the ID of the connection that you want to disconnect.

verbose

A logical, default is TRUE. Whether to print a message during disconnection.

force

A logical, default is FALSE. Whether to remove the connection forcefully. This is useful when you lose the connection and cannot disconnect the connection normally.

Value

A logical, TRUE if the connection is successfully disconnected.

Author(s)

Author: Predictive Analytics Team at Pivotal Inc.

Maintainer: Frank McQuillan, Pivotal Inc. [email protected]

See Also

db.connect creates the database connection.

db.list lists all active connections.

connection info the functions that extract information about the connection.

conn.eql tests whether two connections are the same.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
## Not run: 


## set up the database connection
## Assume that .port is port number and .dbname is the database name
cid <- db.connect(port = .port, dbname = .dbname, verbose = FALSE)

db.list()

## disconnect the connection
db.disconnect(cid, verbose = FALSE)

db.list()

## End(Not run)

PivotalR documentation built on May 30, 2017, 8:18 a.m.