If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Help with DB2 SQLJ at PC platform

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-13-04, 21:09
cybie cybie is offline
Registered User
 
Join Date: Jan 2004
Location: Hong Kong
Posts: 8
Unhappy 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****ntime.profile.RTStatement sqlj****ntime.profile.ref.JDBCProfile.prepareStatem ent(java.lang.String)
sqlj****ntime.profile.RTStatement sqlj****ntime.profile.ref.JDBCProfile.getStatement( int)
sqlj****ntime.profile.RTStatement sqlj****ntime.profile.ref.ProfileWrapper.getStateme nt(int)
sqlj****ntime.profile.RTStatement sqlj****ntime.profile.ref.IterConvertProfile.getSta tement(int)
sqlj****ntime.profile.RTStatement sqlj****ntime.profile.ref.ProfileWrapper.getStateme nt(int)
sqlj****ntime.profile.RTStatement sqlj****ntime.profile.ref.UntypedSelectProfile.getS tatement(int)
sqlj****ntime.profile.RTStatement sqlj****ntime.profile.ref.ProfileWrapper.getStateme nt(int)
sqlj****ntime.profile.RTStatement sqlj****ntime.profile.ref.ParamRegProfile.getStatem ent(int)
sqlj****ntime.profile.RTStatement sqlj****ntime.profile.ref.PositionedProfile.getStat ement(int)
sqlj****ntime.profile.RTStatement sqlj****ntime.profile.ref.TransactionControlProfile .getStatement(int)
sqlj****ntime.profile.RTStatement sqlj****ntime.ExecutionContext$StatementStack.setSt atement(sqlj****ntime.profile.ConnectedProfile, int)
sqlj****ntime.profile.RTStatement sqlj****ntime.ExecutionContext.registerStatement(sq lj****ntime.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.
Reply With Quote
  #2 (permalink)  
Old 01-14-04, 02:32
Marcus_A Marcus_A is offline
Registered User
 
Join Date: May 2003
Location: USA
Posts: 5,198
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
Reply With Quote
  #3 (permalink)  
Old 01-15-04, 02:13
cybie cybie is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 01-15-04, 14:22
GertK GertK is offline
Registered User
 
Join Date: Nov 2003
Location: Netherlands
Posts: 96
Quote:
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.
Reply With Quote
  #5 (permalink)  
Old 01-28-04, 03:03
cybie cybie is offline
Registered User
 
Join Date: Jan 2004
Location: Hong Kong
Posts: 8
Smile

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

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On