Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2004
    Posts
    8

    Question Unanswered: DB2 JDBC driver question??

    I have a sql statement,
    "select * from ITEM_P2P3_QUERY where contains(description, ?) =0"
    But I want to replace the ? as '"P*"'.
    ect * from ITEM where contains(description, '"P*"') =0
    So I can question it in DB2 successfully.
    I used ps.setString(1, "P*"); and ps.setString(1, "'\"aa\"'"); to try it. But I got some exception on this.
    So my question is how to use DB2 JDBC to convert it that it can be executed successfully.

  2. #2
    Join Date
    Nov 2003
    Location
    Jakarta, Indonesia
    Posts
    32

    Re: DB2 JDBC driver question??

    Can you send us the stacktrace

    Regards,
    Adam AC

    Originally posted by agilechen
    I have a sql statement,
    "select * from ITEM_P2P3_QUERY where contains(description, ?) =0"
    But I want to replace the ? as '"P*"'.
    ect * from ITEM where contains(description, '"P*"') =0
    So I can question it in DB2 successfully.
    I used ps.setString(1, "P*"); and ps.setString(1, "'\"aa\"'"); to try it. But I got some exception on this.
    So my question is how to use DB2 JDBC to convert it that it can be executed successfully.

  3. #3
    Join Date
    Jan 2004
    Posts
    8

    Re: DB2 JDBC driver question??

    I just used the Java codes to connect DB2.

    }else if(type == CMType.QUERY_QCRONLY) {
    result.append(" AND (CONTAINS(A.DESCRIPTION,?) = 1 or CONTAINS(A.QCR_NUMBER,?) = 1) ");
    }else if(type == CMType.QUERY_ACTIVITYONLY) {
    result.append(" AND (CONTAINS(A.DESCRIPTION,?) = 1 or CONTAINS(A.ACTIVITY_NUMBER,?) = 1) ");
    }else if(type == CMType.QUERY_REPORTONLY) {
    result.append(" AND (CONTAINS(A.DESCRIPTION,?) = 1 or CONTAINS(A.NAME,?) = 1) ");

    ps.setString(1, fullTextExpr);
    It will throws some exceptions for setString() method.


    Originally posted by adam_ac
    Can you send us the stacktrace

    Regards,
    Adam AC

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •