`

could not execute query

阅读更多

一般这个问题是由于用了工具自动生成*.hbm.xml文件 而发生的错误,一开始你的程序是好的,但是在你换了台机器,访问的数据库有变化时(也许用到里面的表都没有变动),可能就会出现org.hibernate.exception.SQLGrammarException:Could not execute JDBC batch update的问题解决办法是把*.hbm.xml文件的  schema=" " 改为现在对应的用户

User.hbm.xml

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!--
    Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
    <class name="com.wbj.pojo.User" table="user" catalog="bbs" schema="sinoest">
        <id name="id" type="java.lang.Integer">
            <column name="Id" />
            <generator class="increment" />
        </id>
        <property name="username" type="java.lang.String">
            <column name="username" length="20" />
        </property>
        <property name="password" type="java.lang.String">
            <column name="password" length="20" />
        </property>
        <property name="quanxian" type="java.lang.String">
            <column name="quanxian" length="2" />
        </property>
    </class>
</hibernate-mapping>

分享到:
评论
1 楼 love8441258 2009-07-26  
请问楼主 schema=" "  这个我在*.hbm.xml文件的里没有看到呢?可以把你的*.hbm.xml文件贴出来一个吗?

相关推荐

    SSH项目原本使用的sqlserver2005数据库现在改用MySql配置问题修改

    org.springframework.dao.InvalidDataAccessResourceUsageException: could not execute query; nested exception is org.hibernate.exception.SQLGrammarException: could not execute query 我的SSH项目原本...

    关键字user附近有语法错误解决方案

    警告: SQL Error: 156, ...org.hibernate.exception.SQLGrammarException: could not execute query org.hibernate.util.JDBCExceptionReporter logExceptions 严重: 关键字 'user' 附近有语法错误。 的解决方案。

    openousd-api:OpenOUSD的后端材料

    运行本地数据库 设置 注意:需要安装并运行 。...postgres_1 | pg_restore: [archiver (db)] could not execute query: ERROR: table "bargaining_units" does not exist postgres_1 | Command was: DROP TABLE publi

    微软内部资料-SQL性能优化5

    If even one column in the query is not part of the index, the data rows must be accessed. The leaf level of an index is the only level that contains every key value, or set of key values. For a ...

    微软内部资料-SQL性能优化3

    Key range locks are similar to row locks on index keys (whether clustered or not). The locks are placed on individual keys rather than at the node level. The hash value consists of all the key ...

    google api php client

    Once composer is installed, execute the following command in your project root to install this library: ```sh composer require google/apiclient:"^2.0" ``` Finally, be sure to include the autoloader:...

    PHP连接MSSQL2005的扩展插件.

    echo "Could not connect.\n"; die( print_r( sqlsrv_errors(), true)); } /* Get the product picture for a given product ID. */ $tsql = "SELECT LargePhoto FROM Production.ProductPhoto AS p JOIN ...

    sqlmap (懂的入)

    * SQL injection testing and detection does not depend upon the web application database management system back-end. SQL injection exploiting and query syntax obviously depend upon the web ...

    Bochs - The cross platform IA-32 (x86) emulator

    [2938273] allow instrumentation to change execute by Konrad Grochowski [2926072] Indirection operators in expressions by Derek Peschel [2914433] makesym.perl misses symbols by John R. Jackson ...

    VB编程资源大全(英文源码 网络)

    All the operations execute in an asynchronous mode with the progress indication . &lt;END&gt;&lt;br&gt;31 , MultiServer.zip This is real simple source code for a Multi-Client server, it allows upto 65535 ...

    LCTF软件备份VariSpec™ Liquid Crystal Tunable Filters

    Previous revisions did not range-check the palette index number, and hard crashes could be produced if out-of-range values were supplied to this routine. Previous release 1.33b Release date: ...

    SQL21日自学通

    TNS:listener Could Not Resolve SID Given in Connect Descriptor 484 Insufficient Privileges During Grants484 Escape Character in Your Statement--Invalid Character 485 Cannot Create Operating System ...

    VB编程资源大全(英文源码 数据库)

    It is handy in studying database programming.&lt;END&gt;&lt;br&gt;20 , MySQLExplorer.zip Explorer for MySQL Data Base.You can retrieve and execute your query. &lt;END&gt;&lt;br&gt;21 , ICDBaseSource115.zip DAO based ...

    Java邮件开发Fundamentals of the JavaMail API

    the ability to see how many new mail messages they have, are not supported by POP at all. These capabilities are built into programs like Eudora or Microsoft Outlook, which remember things like the ...

    jQuery完全实例.rar

    This function also accepts XML Documents and Window objects as valid arguments (even though they are not DOM Elements). 返回值 jQuery 参数 elements (Element, Array) : 用于封装成jQuery对象的DOM元素 ...

    21天学习SQL V1.0

    21天学习SQL V1.0.pdf 66 SQL 21 日自学通(V1.0) 翻译人笨猪 ...日期/时间函数............................................................................................................ADD_MONTHS..................

Global site tag (gtag.js) - Google Analytics