zoukankan      html  css  js  c++  java
  • insert插入错误

    16:24:30,803  Fetching JDBC Connection from DataSource
    16:24:30,826  Returning JDBC Connection to DataSource
    16:24:30,838  Adding [systemProperties] PropertySource with lowest search precedence
    16:24:30,839  Adding [systemEnvironment] PropertySource with lowest search precedence
    16:24:30,839  Initialized StandardEnvironment with PropertySources [systemProperties,systemEnvironment]
    16:24:30,839  Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
    16:24:30,841  Using JAXP provider [com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderFactoryImpl]
    16:24:30,843  Found beans DTD [http://www.springframework.org/dtd/spring-beans-2.0.dtd] in classpath: spring-beans-2.0.dtd
    16:24:30,856  Loading bean definitions
    16:24:30,902  Creating shared instance of singleton bean 'DB2'
    16:24:30,902  Creating instance of bean 'DB2'
    16:24:30,902  Eagerly caching bean 'DB2' to allow for resolving potential circular references
    16:24:30,911  Finished creating instance of bean 'DB2'
    16:24:30,911  Creating shared instance of singleton bean 'Derby'
    16:24:30,911  Creating instance of bean 'Derby'
    16:24:30,911  Eagerly caching bean 'Derby' to allow for resolving potential circular references
    16:24:30,912  Finished creating instance of bean 'Derby'
    16:24:30,912  Creating shared instance of singleton bean 'H2'
    16:24:30,912  Creating instance of bean 'H2'
    16:24:30,912  Eagerly caching bean 'H2' to allow for resolving potential circular references
    16:24:30,913  Finished creating instance of bean 'H2'
    16:24:30,913  Creating shared instance of singleton bean 'HSQL'
    16:24:30,913  Creating instance of bean 'HSQL'
    16:24:30,913  Eagerly caching bean 'HSQL' to allow for resolving potential circular references
    16:24:30,914  Finished creating instance of bean 'HSQL'
    16:24:30,914  Creating shared instance of singleton bean 'Informix'
    16:24:30,914  Creating instance of bean 'Informix'
    16:24:30,914  Eagerly caching bean 'Informix' to allow for resolving potential circular references
    16:24:30,914  Finished creating instance of bean 'Informix'
    16:24:30,914  Creating shared instance of singleton bean 'MS-SQL'
    16:24:30,914  Creating instance of bean 'MS-SQL'
    16:24:30,914  Eagerly caching bean 'MS-SQL' to allow for resolving potential circular references
    16:24:30,915  Finished creating instance of bean 'MS-SQL'
    16:24:30,915  Creating shared instance of singleton bean 'MySQL'
    16:24:30,915  Creating instance of bean 'MySQL'
    16:24:30,915  Eagerly caching bean 'MySQL' to allow for resolving potential circular references
    16:24:30,916  Finished creating instance of bean 'MySQL'
    16:24:30,916  Creating shared instance of singleton bean 'Oracle'
    16:24:30,916  Creating instance of bean 'Oracle'
    16:24:30,917  Eagerly caching bean 'Oracle' to allow for resolving potential circular references
    16:24:30,917  Finished creating instance of bean 'Oracle'
    16:24:30,918  Creating shared instance of singleton bean 'PostgreSQL'
    16:24:30,918  Creating instance of bean 'PostgreSQL'
    16:24:30,918  Eagerly caching bean 'PostgreSQL' to allow for resolving potential circular references
    16:24:30,919  Finished creating instance of bean 'PostgreSQL'
    16:24:30,919  Creating shared instance of singleton bean 'Sybase'
    16:24:30,919  Creating instance of bean 'Sybase'
    16:24:30,919  Eagerly caching bean 'Sybase' to allow for resolving potential circular references
    16:24:30,920  Finished creating instance of bean 'Sybase'
    16:24:30,920  Creating shared instance of singleton bean 'Hana'
    16:24:30,920  Creating instance of bean 'Hana'
    16:24:30,920  Eagerly caching bean 'Hana' to allow for resolving potential circular references
    16:24:30,921  Finished creating instance of bean 'Hana'
    16:24:30,921  SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase, Hana]
    16:24:30,921  Looking up default SQLErrorCodes for DataSource [org.apache.commons.dbcp.BasicDataSource@e98fb3e]
    16:24:30,927  Fetching JDBC Connection from DataSource
    16:24:30,928  Returning JDBC Connection to DataSource
    16:24:30,928  Database product name cached for DataSource [org.apache.commons.dbcp.BasicDataSource@e98fb3e]: name is 'MySQL'
    16:24:30,929  SQL error codes for 'MySQL' found
    16:24:30,930  Translating SQLException with SQL state '42000', error code '1064', message [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email= '815129029@qq.com'' at line 3]; SQL was [] for task [
    ### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email= '815129029@qq.com'' at line 3
    ### The error may involve com.smart.dao.CompanyDao.CompleteCom-Inline
    ### The error occurred while setting parameters
    ### SQL: insert into company(name,website,city,select_industry_hidden,select_scale_hidden,temptation,principal,phone)         values(?,?,?,?,?,?,?,?)         where email= ?
    ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email= '815129029@qq.com'' at line 3
    ]
    16:24:30,931  Resolving exception from handler [public java.util.Map<java.lang.String, java.lang.Object> com.smart.controller.CompanyController.Completecom(com.smart.bean.Company) throws java.io.IOException]: org.springframework.jdbc.BadSqlGrammarException: 
    ### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email= '815129029@qq.com'' at line 3
    ### The error may involve com.smart.dao.CompanyDao.CompleteCom-Inline
    ### The error occurred while setting parameters
    ### SQL: insert into company(name,website,city,select_industry_hidden,select_scale_hidden,temptation,principal,phone)         values(?,?,?,?,?,?,?,?)         where email= ?
    ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email= '815129029@qq.com'' at line 3
    ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email= '815129029@qq.com'' at line 3
    16:24:30,946  Resolving exception from handler [public java.util.Map<java.lang.String, java.lang.Object> com.smart.controller.CompanyController.Completecom(com.smart.bean.Company) throws java.io.IOException]: org.springframework.jdbc.BadSqlGrammarException: 
    ### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email= '815129029@qq.com'' at line 3
    ### The error may involve com.smart.dao.CompanyDao.CompleteCom-Inline
    ### The error occurred while setting parameters
    ### SQL: insert into company(name,website,city,select_industry_hidden,select_scale_hidden,temptation,principal,phone)         values(?,?,?,?,?,?,?,?)         where email= ?
    ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email= '815129029@qq.com'' at line 3
    ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email= '815129029@qq.com'' at line 3
    16:24:30,947  Resolving exception from handler [public java.util.Map<java.lang.String, java.lang.Object> com.smart.controller.CompanyController.Completecom(com.smart.bean.Company) throws java.io.IOException]: org.springframework.jdbc.BadSqlGrammarException: 
    ### Error updating database.  Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email= '815129029@qq.com'' at line 3
    ### The error may involve com.smart.dao.CompanyDao.CompleteCom-Inline
    ### The error occurred while setting parameters
    ### SQL: insert into company(name,website,city,select_industry_hidden,select_scale_hidden,temptation,principal,phone)         values(?,?,?,?,?,?,?,?)         where email= ?
    ### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email= '815129029@qq.com'' at line 3
    ; bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'where email= '815129029@qq.com'' at line 3
    16:24:30,948  Could not complete request

    原来的我sql语句写错了

    <insert id="CompleteCom" parameterType="Company">
            insert into company(name,website,city,select_industry_hidden,select_scale_hidden,temptation,principal,phone)
            values(#{name},#{website},#{city},#{select_industry_hidden},#{select_scale_hidden},#{temptation},#{principal},#{phone})
            where email= #{email}
        </insert>

    insert不支持where的,应该用update

    <update id="CompleteCom" parameterType="Company">
            UPDATE company
            <set>
                name=#{name},
                website=#{website},
                city=#{city},
                select_industry_hidden=#{select_industry_hidden},
                select_scale_hidden=#{select_scale_hidden},
                temptation=#{temptation},
                principal=#{principal},
                phone=#{phone}
            </set>
            WHERE email=#{email}
        </update>
  • 相关阅读:
    Jzoj3555 树的直径
    Jzoj3555 树的直径
    51Nod1022 石子归并V2
    51Nod1022 石子归并V2
    Bzoj3998 弦论
    Bzoj3998 弦论
    Poj2758 Checking the Text
    Poj2758 Checking the Text
    常用SQL语句大全
    Silverlight调用GP服务第二篇之调用GP服务(Geoprocessing Service)过程详解
  • 原文地址:https://www.cnblogs.com/lwx521/p/8432206.html
Copyright © 2011-2022 走看看