Skip to content
Snippets Groups Projects
Commit b8f4379b authored by somideshmukh's avatar somideshmukh Committed by Sean Owen
Browse files

[SPARK-10946][SQL] JDBC - Use Statement.executeUpdate instead of...

[SPARK-10946][SQL] JDBC - Use Statement.executeUpdate instead of PreparedStatement.executeUpdate for DDLs

New changes with JDBCRDD

Author: somideshmukh <somilde@us.ibm.com>

Closes #9733 from somideshmukh/SomilBranch-1.1.
parent 1714350b
No related branches found
No related tags found
No related merge requests found
......@@ -297,7 +297,7 @@ final class DataFrameWriter private[sql](df: DataFrame) {
if (!tableExists) {
val schema = JdbcUtils.schemaString(df, url)
val sql = s"CREATE TABLE $table ($schema)"
conn.prepareStatement(sql).executeUpdate()
conn.createStatement.executeUpdate(sql)
}
} finally {
conn.close()
......
......@@ -55,7 +55,7 @@ object JdbcUtils extends Logging {
* Drops a table from the JDBC database.
*/
def dropTable(conn: Connection, table: String): Unit = {
conn.prepareStatement(s"DROP TABLE $table").executeUpdate()
conn.createStatement.executeUpdate(s"DROP TABLE $table")
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment