title: how to fetch multiple tables using spark sql
body: <p>I am fetching data from mysql using pyspark which for only one table.I want to fetch all tables from mysql db. Don't want call jdbc connection again and again. see code below</p>
  
  <p>Is it possible to simplify my code? Thank you in advance</p>
  
  <pre><code>url = "jdbc:mysql://localhost:3306/dbname"
  table_df=sqlContext.read.format("jdbc").option("url",url).option("dbtable","table_name").option("user","root").option("password", "root").load()
  sqlContext.registerDataFrameAsTable(table_df, "table1")
  
  table_df_1=sqlContext.read.format("jdbc").option("url",url).option("dbtable","table_name_1").option("user","root").option("password", "root").load()
  sqlContext.registerDataFrameAsTable(table_df_1, "table2")
  </code></pre>