mybatisの使用レコード--ライブラリ名/テーブル名のパラメータ化
今日コードを書く時に1つの問題に出会って、mybatisを使ってパラメータ化の表名を伝える時、終始報告します
Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''ntps_source_case-mgr-server' (service_name, domain, request_type, urlpath, para' at line 1
mybatis , 。
: , sql, : 'ntps_source_case-mgr-server' 。 : 。
mubatis , #{} 。 mybatis ${}, :
#{}
, , sql ;
${}
sql , , ;
: #{} ${}。
![image.png](/img/bVbLqsD)
, :
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-mgr-server (service_name, domain, request_type, urlpath, params, headers, repon' at line 1
sql, sql,
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-mgr-server (
, : "-"。 。 ${} , `${}`.
![image.png](/img/bVbLqtg)