zoukankan      html  css  js  c++  java
  • SpringMVC Mybatis Spring

    Spring MVC Mybatis整合过程中
    Mapper.java 不需要使用 @componenet, Service 等spring注解
    但是在service 中创建mapper对象的时候是需要使用·Resource @Autowired 注解的

    ### Error updating database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
    ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class 'com.microsoft.sqlserver.jdbc.SQLServerDriver'
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:200)
    at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:185)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:358)
    ... 43 more

    have already add mssql jdbc driver and also manual check the class exists.
    <dependency>
    <groupId>com.microsoft.sqlserver</groupId>
    <artifactId>mssql-jdbc</artifactId>
    <version>6.1.0.jre8</version>
    <scope>test</scope>
    </dependency>

    通过mybatis insert foreach 批量插入mysql 因为sqlserver的限制 每次最多只能插入1000条数据  

  • 相关阅读:
    JAVA设计模式之观察者模式 IT
    基本的SqlPlus命令
    JAVA中SERIALVERSIONUID的解释
    msSQL
    java解析超大xml(1G),一般数据挖掘dblp.xml文件的解析
    在oracle中用sql脚本生成csv文件举例
    sql 复习知识大全2
    sql 复习知识大全1
    3.17作业解答
    3.20作业解答
  • 原文地址:https://www.cnblogs.com/zi-yao/p/7609889.html
Copyright © 2011-2022 走看看