Jdbc
Sink plugin : Jdbc [Spark]
Descriptionâ
Support Update
to output data to Relational database
Optionsâ
name | type | required | default value |
---|---|---|---|
driver | string | yes | - |
url | string | yes | - |
user | string | yes | - |
password | string | yes | - |
dbTable | string | yes | - |
saveMode | string | no | error |
useSsl | string | no | false |
customUpdateStmt | string | no | - |
duplicateIncs | string | no | - |
showSql | string | no | true |
url [string]â
The URL of the JDBC connection. Refer to a case: jdbc:mysql://localhost/dbName
user [string]â
username
password [string]â
user password
dbTable [string]â
Source data table name
saveMode [string]â
Storage mode, add mode update
, perform data overwrite in a specified way when inserting data key conflicts
Basic mode, currently supports overwrite
, append
, ignore
and error
. For the specific meaning of each mode, see save-modes
useSsl [string]â
Configure when saveMode
is specified as update
, whether to enable ssl, the default value is false
customUpdateStmt [string]â
Configure when saveMode
is specified as update
, which is used to specify the update statement template for key conflicts
Refer to the usage of INSERT INTO table (...) values (...) ON DUPLICATE KEY UPDATE...
of mysql
, use placeholders or fixed values in values
duplicateIncs [string]â
Configure when saveMode
is specified as update
, and when the specified key conflicts, the value is updated to the existing value plus the original value
showSqlâ
Configure when saveMode
is specified as update
, whether to show sql
Examplesâ
jdbc {
saveMode = "update",
url = "jdbc:mysql://ip:3306/database",
user = "userName",
password = "***********",
dbTable = "tableName",
customUpdateStmt = "INSERT INTO table (column1, column2, created, modified, yn) values(?, ?, now(), now(), 1) ON DUPLICATE KEY UPDATE column1 = IFNULL(VALUES (column1), column1), column2 = IFNULL(VALUES (column2), column2)"
}