Could not get JDBC Connection; nested exception is java.sql.SQLException: Java does not support the
最近在摸索tapestry5,07年就出现的技术为啥资料如此至少哦,
spring+tapestry5 +mysql
在 连接数据库的时候,提示:Could not get JDBC Connection; nested exception is java.sql.SQLException: Java does not support the
刚开始是mysql的服务没有启动,
启动后有报:
Could not get JDBC Connection; nested exception is java.sql.SQLException: Java does not support theUTF-8
发现在配置url的时候,有添加字符集编码
jdbc:mysql://127.0.0.1:3306/wo?useUnicode=true&characterEncoding='UTF-8'
<bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
<property name="dataSource" ref="dataSource"/>
</bean>
<bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://127.0.0.1:3306/wo?useUnicode=true&characterEncoding=UTF-8"/> <property name="username" value="root"/>
<property name="password" value="123"/>
</bean>
注意:&characterEncoding=utf-8的写法
在tapestry中xml配置中
是: &characterEncoding=utf-8
不然会报错的
把两个单引号去掉,搞定