[SPARK-2710] [SQL] Build SchemaRDD from a JdbcRDD with MetaData

SPARK-2710 Build SchemaRDD from a JdbcRDD with MetaData

and a small bug fix on JdbcRDD, line 109
it seems conn will never be closed


This probably contains 2 bugs:
* Not consistent with `JdbcTypes.toPrimitiveDataType`

As `java.sql.Types.DATE`, `java.sql.Types.TIME` and `java.sql.Types.CLOB` all of them will cast into `StringType` in  `JdbcTypes.toPrimitiveDataType`, `rs.getString` for `java.sql.Types.TIME` here may cause exception.
* Null value checking

According to the document of ResultSet, the primitive type getter methods will return a default value if null value found. For example the API `int getInt(int columnIndex)` will returns `0` if the actual value is `null`.
We can write the code like:
```
val iVal = rs.getInt("ID_PARENT")
if (rs.wasNull()) {
  row.update(i, null)
} else {
  row.update(i, iVal)
}
```