dbConnect                package:Rdbi                R Documentation

_C_o_n_n_e_c_t _t_o _a _d_a_t_a_b_a_s_e

_D_e_s_c_r_i_p_t_i_o_n:

     'dbConnect' is a generic function that, when evoked with a valid
     database class, will return a connection object.

_U_s_a_g_e:

     dbConnect(dbObj, ...)

_A_r_g_u_m_e_n_t_s:

   dbObj: A database class object.

     ...: An argument list specifying connection options.

_D_e_t_a_i_l_s:

     Each package that sub-classes Rdbi must provide a 'dbConnect'
     function.  The first argument of the 'dbConnect' function is an
     object whose class determines which 'dbConnect' method is actually
     called.  For example, the Rdbi.PgSQL package provides a function
     'PgSQL()' that returns an object of class 'c("PgSQL", "Rdbi")'. 
     Therefore the call 'dbConnect(PgSQL(), ...)' will invoke the
     method 'dbConnect.PgSQL'.  Rdbi arranges for the specific package
     to be loaded via the 'autoload' mechanism.  In this example,
     Rdbi.PgSQL is autoloaded when 'PgSQL' is called.

_V_a_l_u_e:

     A database connection object that inherits from "Rdbi.conn".
     Additionally, the connection object should possess two attributes
     required to reopen the connection from the object.  The
     "library.call" contains a call or expression that will load the
     library necessary to support the connection object.  The
     "connect.call" attribute should contain the call that created the
     connection object.  Also, it is very convenient to arrange for
     low-level connection resources to be freed when the R connection
     object is garbage collected.  See the Rdbi.PgSQL C code for an
     example.

_A_u_t_h_o_r(_s):

     Timothy H. Keitt

_R_e_f_e_r_e_n_c_e_s:

     <URL: http://rdbi.sourceforge.net/>

_S_e_e _A_l_s_o:

     'dbDisconnect', 'dbReconnect', methods, 'class', 'match.call'

