mybatis集成spring查不出数据
这是控制台信息CreatinganewSqlSessionSqlSession[org.apache.ibatis.session.defaults.DefaultSql...
这是控制台信息
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5c4eb823] was not
registered for synchronization because synchronization is not active
二月 08, 2017 7:09:28 下午 com.alibaba.druid.pool.DruidDataSource info
信息: {dataSource-1} inited
JDBC Connection [com.mysql.jdbc.JDBC4Connection@76f60564] will not be managed by Spring
==> Preparing: select *
WHERE username = ? and password = ?
==> Parameters: zhangsan(String), 123
(String)
<== Total: 0
Closing non transactional SqlSession
[org.apache.ibatis.session.defaults.DefaultSqlSession@5c4eb823]
为什么<== Total:0
我在mysql命令行直接查 select * from tb_user WHERE username = ‘zhangsan’ and password = '123'却有数据 展开
Creating a new SqlSession
SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@5c4eb823] was not
registered for synchronization because synchronization is not active
二月 08, 2017 7:09:28 下午 com.alibaba.druid.pool.DruidDataSource info
信息: {dataSource-1} inited
JDBC Connection [com.mysql.jdbc.JDBC4Connection@76f60564] will not be managed by Spring
==> Preparing: select *
WHERE username = ? and password = ?
==> Parameters: zhangsan(String), 123
(String)
<== Total: 0
Closing non transactional SqlSession
[org.apache.ibatis.session.defaults.DefaultSqlSession@5c4eb823]
为什么<== Total:0
我在mysql命令行直接查 select * from tb_user WHERE username = ‘zhangsan’ and password = '123'却有数据 展开
展开全部
最近在搭建maven + springmvc + spring + mybatis + MySQL 过程中遇到一个问题(tomcat启动的时候报异常
Java.lang.IllegalStateException: Could not load JDBC driver class [${jdbc_driverClassName}])经过查询相关资料最后解决,解决如下:
开始我的application.xml中配置如下:
<!-- 引入jdbc配置文件 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath*:/jdbc.properties</value>
<!--要是有多个配置文件,只需在这里继续添加即可 -->
</list>
</property>
</bean>
Java.lang.IllegalStateException: Could not load JDBC driver class [${jdbc_driverClassName}])经过查询相关资料最后解决,解决如下:
开始我的application.xml中配置如下:
<!-- 引入jdbc配置文件 -->
<bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
<property name="locations">
<list>
<value>classpath*:/jdbc.properties</value>
<!--要是有多个配置文件,只需在这里继续添加即可 -->
</list>
</property>
</bean>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |