Mysql in the keyword field, how to deal with

In doing database connection configuration, field database connection needs to be written to the database table when inserting new database information found insert failed.

Field contents as host, port, username, password, database, write insert statements in the database field to find that some keywords color.

Solution, add the keyword in the anti-quotation marks, as follows, it can be successfully inserted into the database.

 @Insert("insert into datasource_config(`host`,`port`,username,`password`,`database`) values(" +
            "#{host},#{port},#{username},#{password},#{database})")

 

Published 36 original articles · won praise 19 · views 30000 +

Guess you like

Origin blog.csdn.net/qq_27182767/article/details/103994620