Menu

#30 Error Adding Publications and Articles

closed-fixed
nobody
5
2006-12-12
2005-01-09
robbyy
No

My installation is Cofax 2.0 RC3. I am using Tomcat
4.1.30 on Linux... when editing an article, adding a
publication, etc i get the following error:

CofaxToolsServlet doGet ERROR: occurred during a
database transaction: MySqlDataStore getPackageData
ERROR: java.sql.SQLException: Can not issue data
manipulation statements with executeQuery()

Discussion

  • Redbeardsb

    Redbeardsb - 2005-02-19

    Logged In: YES
    user_id=1222831

    Error is due to more recent jdbc compliant driver which is
    enforcing a restriction that any database transaction that
    is manipulating data must use either the Statement.execute()
    or Statement.executeUpdate() instead of the
    Statement.executeQuery used in the smile section of the
    library code. I found a similar error reported on the mysql
    web site:

    How to repeat:

    sqlQuery = "UPDATE documents SET web_exp = NOW() WHERE
    fund_id='" + fund_id + "'
    AND doctype='" + doctype + "' AND web_ver ='" + web_ver + "'
    AND (web_exp IS
    NULL OR TO_DAYS(web_exp) > TO_DAYS(NOW()))";
    rs = stmt.executeQuery(sqlQuery);

    [20 Jun 2003 9:03am] Mark Matthews

    The JDBC spec states that you must either use
    Statement.executeUpdate() or
    Statement.execute() for queries that manipulate data (such
    as your 'UPDATE
    documents SET web_exp....' query).

    Older versions of the JDBC driver were more lax on this.
    However, it is
    important to be JDBC-compliant, so the later versions of the
    driver enforce this
    requirement.

     
  • F.X. Robin

    F.X. Robin - 2006-12-12

    Logged In: YES
    user_id=1283696
    Originator: NO

    refactoring executeQuery() into execute()

     
  • F.X. Robin

    F.X. Robin - 2006-12-12
    • status: open --> closed-fixed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.