dbConnect-methods           package:RMySQL           R Documentation

_C_r_e_a_t_e _a _c_o_n_n_e_c_t_i_o_n _o_b_j_e_c_t _t_o _a_n _M_y_S_Q_L _D_B_M_S

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

     These methods are straight-forward implementations of the
     corresponding generic functions.

_M_e_t_h_o_d_s:

     _d_r_v an object of class 'MySQLDriver', or the character string
          "MySQL" or an 'MySQLConnection'.

     _c_o_n_n an 'MySQLConnection' object as produced by 'dbConnect'.

     _u_s_e_r_n_a_m_e string of the MySQL login name.

     _p_a_s_s_w_o_r_d string with the MySQL password.

     _d_b_n_a_m_e string with the database name.

     _h_o_s_t string identifying the host machine running the MySQL server
          an empty string '""' is interpreted as '"localhost"'.

     _u_n_i_x._s_o_c_k_e_t (optional) unix socket or named pipe.

     _p_o_r_t (optional) TCP/IP default port.

     _c_l_i_e_n_t._f_l_a_g (optional) integer setting various MySQL client flags.
          See the MySQL manual for details.

     _g_r_o_u_p string identifying a section in the '\$HOME/.my.cnf' to use
          for setting authentication parameters (see 'MySQL'.)

     ...  Currently unused.

_S_i_d_e _E_f_f_e_c_t_s:

     A connection between R/S-Plus and an MySQL  server is 
     established.   The current implementation supports up to 100
     simultaneous connections.

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

     See the Database Interface definition document 'DBI.pdf' in the
     base directory of this package or <URL:
     http://stat.bell-labs.com/RS-DBI>.

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

     'MySQL', 'dbConnect', 'dbSendQuery', 'dbGetQuery', 'fetch',
     'dbCommit', 'dbGetInfo', 'dbReadTable'.

_E_x_a_m_p_l_e_s:

     ## Not run: 
     # create an MySQL instance and create one connection.
     drv <- dbDriver("MySQL")

     # open the connection using user, passsword, etc., as
     con <- dbConnect(drv, group = "rs-dbi")

     # Run an SQL statement by creating first a resultSet object
     rs <- dbSendQuery(con, statement = paste(
                           "SELECT w.laser_id, w.wavelength, p.cut_off",
                           "FROM WL w, PURGE P", 
                           "WHERE w.laser_id = p.laser_id", 
                           "SORT BY w.laser_id")
     # we now fetch records from the resultSet into a data.frame
     data <- fetch(rs, n = -1)   # extract all rows
     dim(data)
     ## End(Not run)

