conn.eql: Check whether two connections are the same

Description Usage Arguments Value Author(s) See Also Examples

View source: R/utility-conn_attr.R

Description

Two connections are regarded as equal if and only if they have the same database name, host, DBMS, and port number.

Usage

1
conn.eql(conn.id1, conn.id2)

Arguments

conn.id1

An integer, a connection ID number.

conn.id2

An integer, another connection ID number.

Value

A logical. TRUE if and only if the two connections have the same database name, host, DBMS, and port number.

Author(s)

Author: Predictive Analytics Team at Pivotal Inc.

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

See Also

connection info has all functions that can extract information about the database connection.

db.connect creates connections to the databases.

db.disconnect disconnects an existing connection.

db.list lists all the current connections with their information.

Examples

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


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

db.list() # list the above two connections

conn.eql(cid1, cid2) # returns TRUE

db.disconnect(cid1, verbose = FALSE)
db.disconnect(cid2, verbose = FALSE)

## End(Not run)

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