将mybatis中xml文件的properties标签内容转到另外一个外部配置文件中报错
Cannot load connection class because of underlying exception: com.mysql.cj.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near ';characterEncoding=utf8&useSSL=false&serverTimezone=GMT%2B8'.
我意识到应该是.properties文件和.xml数据库连接的url部分中的&&的解读方式不一样,在.xml文件中&&应该被写成&
而在.properties中应该是&&
,所以我把.xml文件的url中的&
改为&&
后成功运行。