Results 1 to 5 of 5
  1. #1
    Join Date
    Jan 2004
    Location
    Hong Kong
    Posts
    8

    Unhappy Unanswered: Help with DB2 SQLJ at PC platform

    Currently i'm writing programs which involves access to DB2 tables via SQLJ. One of the development aim is to make the source code transparent (i.e. able to run in both OS/390 platform and PC platform).

    However, when i tried to develop SQLJ code which involve uncomitted read (UR) - we experienced problem in PC platform. The SQL below

    SELECT COUNT(CTRY) INTO :numberOfRecords
    FROM VICQITM QITM, VICSVMP SVMP WHERE QITM.MSG_NAM IN
    (SELECT MSG_NAM FROM VICQITM WHERE QUE_ITEM_ID = :queueItemID)
    WITH UR

    can be successfully translated in both PC and OS/390 platform. While in OS/390 platform is able to execute the program without any problem, in PC (currently in Windows 2000 Prof running VisualAge for Java as IDE) it returns a SQL exception which states there is error in token:

    COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2/NT] SQL0104N An unexpected token "WITH" was found following "E QUE_ITEM_ID = ? )". Expected tokens may include: "<concat>". SQLSTATE=42601

    java.lang.Throwable(java.lang.String)
    java.lang.Exception(java.lang.String)
    java.sql.SQLException(java.lang.String, java.lang.String, int)
    COM.ibm.db2.jdbc.DB2Exception(java.lang.String, java.lang.String, int, byte [])
    COM.ibm.db2.jdbc.DB2Exception(java.lang.String, java.lang.String, int)
    void COM.ibm.db2.jdbc.net.SQLExceptionGenerator.throw_S QLException(COM.ibm.db2.jdbc.net.DB2Statement, boolean)
    void COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_r eturn_code(COM.ibm.db2.jdbc.net.DB2Statement, int, boolean)
    void COM.ibm.db2.jdbc.net.SQLExceptionGenerator.check_r eturn_code(COM.ibm.db2.jdbc.net.DB2Statement, int)
    COM.ibm.db2.jdbc.net.DB2PreparedStatement(java.lan g.String, COM.ibm.db2.jdbc.net.DB2Connection, int, int)
    COM.ibm.db2.jdbc.net.DB2PreparedStatement(java.lan g.String, COM.ibm.db2.jdbc.net.DB2Connection)
    java.sql.PreparedStatement COM.ibm.db2.jdbc.net.DB2Connection.prepareStatemen t(java.lang.String)
    sqlj.runtime.profile.RTStatement sqlj.runtime.profile.ref.JDBCProfile.prepareStatem ent(java.lang.String)
    sqlj.runtime.profile.RTStatement sqlj.runtime.profile.ref.JDBCProfile.getStatement( int)
    sqlj.runtime.profile.RTStatement sqlj.runtime.profile.ref.ProfileWrapper.getStateme nt(int)
    sqlj.runtime.profile.RTStatement sqlj.runtime.profile.ref.IterConvertProfile.getSta tement(int)
    sqlj.runtime.profile.RTStatement sqlj.runtime.profile.ref.ProfileWrapper.getStateme nt(int)
    sqlj.runtime.profile.RTStatement sqlj.runtime.profile.ref.UntypedSelectProfile.getS tatement(int)
    sqlj.runtime.profile.RTStatement sqlj.runtime.profile.ref.ProfileWrapper.getStateme nt(int)
    sqlj.runtime.profile.RTStatement sqlj.runtime.profile.ref.ParamRegProfile.getStatem ent(int)
    sqlj.runtime.profile.RTStatement sqlj.runtime.profile.ref.PositionedProfile.getStat ement(int)
    sqlj.runtime.profile.RTStatement sqlj.runtime.profile.ref.TransactionControlProfile .getStatement(int)
    sqlj.runtime.profile.RTStatement sqlj.runtime.ExecutionContext$StatementStack.setSt atement(sqlj.runtime.profile.ConnectedProfile, int)
    sqlj.runtime.profile.RTStatement sqlj.runtime.ExecutionContext.registerStatement(sq lj.runtime.ConnectionContext, java.lang.Object, int)
    void study.URTest.readCount()
    void study.URTest.main(java.lang.String [])

    Could anyone here please help what's going and how to fix the problem. Thanks in advance.

  2. #2
    Join Date
    May 2003
    Location
    USA
    Posts
    5,737
    As explained in the “READ ME: Must read before posting” thread, you need to document what platforms (OS) and DB2 release (including FP's) you are using. Information about Java versions might also be useful.
    M. A. Feldman
    IBM Certified DBA on DB2 for Linux, UNIX, and Windows
    IBM Certified DBA on DB2 for z/OS and OS/390

  3. #3
    Join Date
    Jan 2004
    Location
    Hong Kong
    Posts
    8
    Thanks. sorry that i haven't mention clearly about the information.

    For the testing successfully case with UR case, we are performing in
    OS/390 environment with DB2 UDB V7.1, and the Java version used is JDK 1.3.1 (in WAS 4.0)

    For the testing which end up throwing SQLException, it is run at Windows 2000 Prof platform, with also DB2 UDB V7.1, and the JDK is of version 1.2.2. (Actually it runs on VisualAge for Java V3.5.3)

    Hope it helps. Thanks.

  4. #4
    Join Date
    Nov 2003
    Location
    Netherlands
    Posts
    96
    Originally posted by cybie
    Thanks. sorry that i haven't mention clearly about the information.

    For the testing successfully case with UR case, we are performing in
    OS/390 environment with DB2 UDB V7.1, and the Java version used is JDK 1.3.1 (in WAS 4.0)

    For the testing which end up throwing SQLException, it is run at Windows 2000 Prof platform, with also DB2 UDB V7.1, and the JDK is of version 1.2.2. (Actually it runs on VisualAge for Java V3.5.3)

    Hope it helps. Thanks.
    If I do remember right, you must install FP3 before the 'WITH UR' can be used.

  5. #5
    Join Date
    Jan 2004
    Location
    Hong Kong
    Posts
    8

    Smile

    Thanks GertK. It works fine after install DB2 V7 FixPak 3.

Posting Permissions

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