It is not clear from the information provided why the insertIntoJDBC failed in #2. I would note that method on the DataFrame as been deprecated since 1.4, not sure what version your on. You should be able to do something like this:
DataFrame.write.mode(SaveMode.Append).jdbc(MYSQL_CONNECTION_URL_WRITE, "track_on_alarm", connectionProps) HTH. -Todd On Fri, Jan 8, 2016 at 10:53 AM, Ted Yu <yuzhih...@gmail.com> wrote: > Which Spark release are you using ? > > For case #2, was there any error / clue in the logs ? > > Cheers > > On Fri, Jan 8, 2016 at 7:36 AM, Yasemin Kaya <godo...@gmail.com> wrote: > >> Hi, >> >> I want to write dataframe existing mysql table, but when i use >> *peopleDataFrame.insertIntoJDBC(MYSQL_CONNECTION_URL_WRITE, >> "track_on_alarm",false)* >> >> it says "Table track_on_alarm already exists." >> >> And when i *use peopleDataFrame.insertIntoJDBC(MYSQL_CONNECTION_URL_WRITE, >> "track_on_alarm",true)* >> >> i lost the existing data. >> >> How i can write new data to db? >> >> Best, >> yasemin >> >> -- >> hiç ender hiç >> > >