如何使用spring.xml在JDBC中配置postgressqlURL



我们的项目使用Springmvc。在Spring.xml中,我们希望使用新迁移的postgresdb。但是我们无法配置url。

<bean id="jt" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="ds"></property>
</bean>

这给了我们一个错误:[err]

org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.postgresql.util.PSQLException: Invalid sslmode value: verify-full;sslrootcert=/opt/ibm/wlp/usr/servers/defaultServer/resources/iitStaticContent/root.crt
[err]   at org.springframework.jdbc.datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80)
[err]   at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:390)

您使用与号(&(而不是分号(;(来分隔URL中的选项。

您可能需要将其编码为XML中的&amp;

最新更新