当尝试在STS中用jetty:run-war -P MySQL选项使用应用程序时,我需要在MySQL JDBC中传递几个参数,没有典型的选项,也不起作用,
jdbc:mysql://localhost:3306/petclinic?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC或
jdbc:mysql://localhost:3306/petclinic?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC干过
发布于 2022-02-03 09:31:53
您需要使用CDATA双转义URL,因此XML验证程序忽略&,然后使用&,因为JDBC字符串是用XML验证处理的。以下工作取得了成效:
<properties>
<db.script>mysql</db.script>
<jpa.database>MYSQL</jpa.database>
<jdbc.driverClassName>com.mysql.cj.jdbc.Driver</jdbc.driverClassName>
<jdbc.url><![CDATA[jdbc:mysql://localhost:3306/petclinic?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC]]></jdbc.url>
<jdbc.username>petclinic</jdbc.username>
<jdbc.password>petclinic</jdbc.password>
</properties>https://stackoverflow.com/questions/70968785
复制相似问题