问题一:
一般的,在JDBC配置中我们会这么写:
jdbc:mysql://localhost:3306/ee19_spring_day02?useUnicode=true&characterEncoding=utf-8&useSSL=false
当我们把这样的代码写入spring的dbcp的bean时后会发现报错,这是因为在xml文件中需要用“;”符号隔开,而在XML文件中,应该写成“amp;” 就没有问题了。 如:
<property name="url" value="jdbc:mysql://localhost:3306/ee19_spring_day02?useUnicode=true&characterEncoding=utf-8&useSSL=false"></property>
问题二:
<property name="url" value="jdbc:mysql://localhost:3306/ee19_spring_day02?useUnicode=true&characterEncoding=utf-8&useSSL=false;"></property>
如图中的代码,我们会发现报错,因为在bean中,最后时不应该加上“;”的;应该改为
<property name="url" value="jdbc:mysql://localhost:3306/ee19_spring_day02?useUnicode=true&characterEncoding=utf-8&useSSL=false"></property>