title: R: No applicable method for 'tbl' error when making a SQL Server query using dplyr and pool
body: <p>Apologies if this has been answered elsewhere, but I could not find it. With the following code I am connecting to an MS SQL database using the RJDBC mechanism using pooling from the pool package:</p>
  
  <pre><code>library(RJDBC)
  library(DBI)
  library(pool)
  library(dplyr)
  
  drv &lt;-
    JDBC(
      "com.microsoft.sqlserver.jdbc.SQLServerDriver",
      "C:/R/RJDBC/Microsoft JDBC Driver 6.0 for SQL Server/sqljdbc_6.0/enu/jre8/sqljdbc42.jar"
    )
  
  pool_instance &lt;- dbPool(
    drv = drv,
    dbname = "dbasename",
    url = "jdbc:sqlserver://sql01",
    user = "user",
    password = "password"
  )
  
  mydata &lt;- dbGetQuery(pool_instance, "select * from my.Table")
  src_pool(pool_instance) %&gt;% tbl("my.Table") %&gt;% head(5)
  </code></pre>
  
  <p>When I run this code, I make a successful connection to my SQL Server database and the <code>dbGetQuery</code> function call retrieves the data as expected. </p>
  
  <p>However, when I call the <code>src_pool</code> function I get the following error message:</p>
  
  <blockquote>
    <p>Error in UseMethod("tbl") :    no applicable method for 'tbl' applied
    to an object of class "c('src_', 'src_sql', 'src')"</p>
  </blockquote>
  
  <p>If I call the function <code>src_pool(pool_instance)</code> separately, without piping to the tbl function, the error message is similar:</p>
  
  <blockquote>
    <p>Error in UseMethod("src_desc") :    no applicable method for
    'src_desc' applied to an object of class "c('src_', 'src_sql', 'src')"</p>
  </blockquote>
  
  <p>I expected that either dplyr or pool would provide for these methods? Do I need to write code for these methods? What am I missing?</p>
  
  <p>Note that I am a newby to SQL Server database connectivity. </p>