conn.id | R Documentation |
db.obj
object
Each db.obj
object contains the ID of the connection that its
data resides on. This function returns the connection ID number. The
user can also change the connection ID that a db.obj
is
associated with.
conn.id(x)
conn.id(x) <- value
x |
A |
value |
An integer, the connection ID number. The user is allowed to change
the connection ID that is associated with |
An integer, the connection ID associated with x
Author: Predictive Analytics Team at Pivotal Inc.
Maintainer: Frank McQuillan, Pivotal Inc. fmcquillan@pivotal.io
db.connect
creates connections to the databases.
db.disconnect
disconnects an existing connection.
db.list
lists all the current connections with their
information.
connection info
has all functions that can extract
information about the database connection.
conn.eql
tests whether two connections are actually the
same one.
## 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 two connections
conn.eql(cid1, cid2) # returns TRUE
## use the example data to create a table in connection 1
delete("abalone", conn.id = cid2)
x <- as.db.data.frame(abalone, "abalone", conn.id = cid1, verbose = FALSE)
db.disconnect(cid1) # disconnect connection 1
## lookat(x) # gives an error since connection 1 is disconnected
conn.id(x) <- cid2 # 1 and 2 are the same
lk(x) # gives what you want
db.disconnect(cid2, verbose = FALSE)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.