Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3
    • Fix Version/s: None
    • Labels:
      None
    • Environment:

      windows xp,tomcat,mssql,mysql,sqlite

      Description

      i have a table maintances(id,tr_userid,trouble,tr_time),id is autoincrement.when i use code below insert into table
      QueryRunner runner = new QueryRunner();
      runner.update(conn,"INSERT INTO maintances(tr_userid,trouble,tr_time) values(?,?,?)",1,"2","2009-01-01");
      successed in mysql,sqlite
      in mssql has error(Keyword 'where' syntax error near);i test in mssql2000,mssql2005,use new and old jdbc, the same result.
      stacktrace
      Caused by:java.sql.SQLException:com.microsoft.sqlserver.jdbc.SQLServerException:关键字'where'附近有语法错误。Query:,"INSERT INTO maintances(tr_userid,trouble,tr_time) values(?,?,?) Parameters:[1,2,2009-01-01]
      at org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:542)
      at org.apache.commons.dbutils.QueryRunner.rethrow(QueryRunner.java:599)
      at com.softwarementors.extjs.djn.demo.Maintance.insertMaintance(Maintance.java:49)

      1. Configurations.java
        3 kB
        sjy
      2. Maintance.java
        2 kB
        sjy
      3. QueryHelper.java
        4 kB
        sjy

        Activity

        Hide
        sjy added a comment -

        the problem is jdbc error

        Show
        sjy added a comment - the problem is jdbc error
        Hide
        sjy added a comment -

        i have solved it,wo used jtds driver,it's work well.

        Show
        sjy added a comment - i have solved it,wo used jtds driver,it's work well.
        Hide
        sjy added a comment -

        i have attach my java code, and add track trace about this problom

        Show
        sjy added a comment - i have attach my java code, and add track trace about this problom
        Hide
        Julien Aymé added a comment -

        Could you provide more informations regarding the mssql error, such as the stacktrace ?

        Show
        Julien Aymé added a comment - Could you provide more informations regarding the mssql error, such as the stacktrace ?
        Hide
        Julien Aymé added a comment -

        Hi,

        I don't think this is a DBUTILS issue, rather a SQL issue.
        In order to make your code more independant from the database you use, you should specify the columns to insert into:

        "INSERT INTO maintances(tr_userid, trouble, tr_time) values(?,?,?)"

        Note that you should ask your questions on the user list before creating an issue, if you are not sure this is an issue.

        Regards,
        Julien

        Show
        Julien Aymé added a comment - Hi, I don't think this is a DBUTILS issue, rather a SQL issue. In order to make your code more independant from the database you use, you should specify the columns to insert into: "INSERT INTO maintances(tr_userid, trouble, tr_time) values(?,?,?)" Note that you should ask your questions on the user list before creating an issue, if you are not sure this is an issue. Regards, Julien

          People

          • Assignee:
            Unassigned
            Reporter:
            sjy
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 168h
              168h
              Remaining:
              Remaining Estimate - 168h
              168h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development