Unix Technical Forum

Re: ResultSet is not updatable.

This is a discussion on Re: ResultSet is not updatable. within the DB2 forums, part of the Database Server Software category; --> hi, i am using db2 v8.1 udb fix pack 2 on NT. db2jcc.jar is the jdbc driver we use, ...


Go Back   Unix Technical Forum > Database Server Software > DB2

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-26-2008, 09:46 AM
xixi
 
Posts: n/a
Default Re: ResultSet is not updatable.

hi, i am using db2 v8.1 udb fix pack 2 on NT. db2jcc.jar is the jdbc
driver we use, it is type 4. the url is

DB_URL=jdbc:db2://xxx.xx.x.xx:50000/xxx

as i look , sensitive resultset and updatable resultset is supported
for type 4.


from this url

http://www-3.ibm.com/software/data/d...a/r0010294.htm

so would you please do the test from your side? thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-26-2008, 09:46 AM
sharpe@us.ibm.com
 
Posts: n/a
Default Re: ResultSet is not updatable.

Hi,
I have the following suggestion, from my jdbc friend:
<quote/>
Can we try to find the build number by adding the following codecase:

// turn on trace
try {
DriverManager.setLogWriter(
new java.io.PrintWriter (
new java.io.BufferedOutputStream (
new java.io.FileOutputStream (traceFile), 4096), true));
// traceFile is a String which contains the name of the trace file
}
catch (java.io.FileNotFoundException e) {
}
catch (java.io.IOException e1) {
}

// Get connection 1
conn1 = DriverManager.getConnection(urlJcc,prop);

</quote>


xixi wrote:

>hi, i am using db2 v8.1 udb fix pack 2 on NT. db2jcc.jar is the jdbc
>driver we use, it is type 4. the url is
>
>DB_URL=jdbc:db2://xxx.xx.x.xx:50000/xxx
>
>as i look , sensitive resultset and updatable resultset is supported
>for type 4.
>
>
>from this url
>
>http://www-3.ibm.com/software/data/d...a/r0010294.htm
>
>so would you please do the test from your side? thanks
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 02-26-2008, 09:47 AM
sharpe@us.ibm.com
 
Posts: n/a
Default Re: ResultSet is not updatable.

Hi xixi,
Sherry tells me:

From the trace it looks like you are using the Driver from FP1,
[ibm][db2][jcc][Connection@8c436b] Driver version: 1.1.67.

FP2 would be "1.2.XX". You may have download FP2 but failed to point
her classpath to it.
Find out where your fp2 db2jcc.jar is and set classpath to it.

set classpath=c:\blah\db2jcc.jar;%classpath%

xixi wrote:

>hi, i am using db2 v8.1 udb fix pack 2 on NT. db2jcc.jar is the jdbc
>driver we use, it is type 4. the url is
>
>DB_URL=jdbc:db2://xxx.xx.x.xx:50000/xxx
>
>as i look , sensitive resultset and updatable resultset is supported
>for type 4.
>
>
>from this url
>
>http://www-3.ibm.com/software/data/d...a/r0010294.htm
>
>so would you please do the test from your side? thanks
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 02-26-2008, 09:48 AM
xixi
 
Posts: n/a
Default Re: ResultSet is not updatable.

hello

i do have db2jcc.jar from fp2, but when i use it to get connection, i
got the error

com.ibm.db2.jcc.c.SqlException: The version of the IBM Universal JDBC
driver in use is not licensed for connectivity to DB2 for Unix/Windows
databases. To connect to this DB2 server, please obtain a licensed
copy of the IBM DB2 Universal Driver for JDBC and SQLJ.

we are just using trial edition of db2 udb server.

so that is why i have to use db2jcc.jar from fp1. so can i use this
version to solve my problem? thanks

sharpe@us.ibm.com wrote in message news:<3EFCE642.9080304@us.ibm.com>...
> Hi xixi,
> Sherry tells me:
>
> From the trace it looks like you are using the Driver from FP1,
> [ibm][db2][jcc][Connection@8c436b] Driver version: 1.1.67.
>
> FP2 would be "1.2.XX". You may have download FP2 but failed to point
> her classpath to it.
> Find out where your fp2 db2jcc.jar is and set classpath to it.
>
> set classpath=c:\blah\db2jcc.jar;%classpath%
>
> xixi wrote:
>
> >hi, i am using db2 v8.1 udb fix pack 2 on NT. db2jcc.jar is the jdbc
> >driver we use, it is type 4. the url is
> >
> >DB_URL=jdbc:db2://xxx.xx.x.xx:50000/xxx
> >
> >as i look , sensitive resultset and updatable resultset is supported
> >for type 4.
> >
> >
> >from this url
> >
> >http://www-3.ibm.com/software/data/d...a/r0010294.htm
> >
> >so would you please do the test from your side? thanks
> >

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-26-2008, 09:48 AM
sharpe@us.ibm.com
 
Posts: n/a
Default Re: ResultSet is not updatable.

Hi Xixi,
I don't know, but will try to find out for you.

xixi wrote:

>hello
>
>i do have db2jcc.jar from fp2, but when i use it to get connection, i
>got the error
>
>com.ibm.db2.jcc.c.SqlException: The version of the IBM Universal JDBC
>driver in use is not licensed for connectivity to DB2 for Unix/Windows
>databases. To connect to this DB2 server, please obtain a licensed
>copy of the IBM DB2 Universal Driver for JDBC and SQLJ.
>
>we are just using trial edition of db2 udb server.
>
>so that is why i have to use db2jcc.jar from fp1. so can i use this
>version to solve my problem? thanks
>
>sharpe@us.ibm.com wrote in message news:<3EFCE642.9080304@us.ibm.com>...
>
>>Hi xixi,
>>Sherry tells me:
>>
>> From the trace it looks like you are using the Driver from FP1,
>>[ibm][db2][jcc][Connection@8c436b] Driver version: 1.1.67.
>>
>>FP2 would be "1.2.XX". You may have download FP2 but failed to point
>>her classpath to it.
>>Find out where your fp2 db2jcc.jar is and set classpath to it.
>>
>>set classpath=c:\blah\db2jcc.jar;%classpath%
>>
>>xixi wrote:
>>
>>>hi, i am using db2 v8.1 udb fix pack 2 on NT. db2jcc.jar is the jdbc
>>>driver we use, it is type 4. the url is
>>>
>>>DB_URL=jdbc:db2://xxx.xx.x.xx:50000/xxx
>>>
>>>as i look , sensitive resultset and updatable resultset is supported
>>>for type 4.
>>>
>>>
>>>from this url

>>
>>>http://www-3.ibm.com/software/data/d...a/r0010294.htm
>>>
>>>so would you please do the test from your side? thanks
>>>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 02-26-2008, 09:48 AM
sharpe@us.ibm.com
 
Posts: n/a
Default Re: ResultSet is not updatable.

Hi xixi,
Here is what I have been told:
<qoute/>
look for the license jar file in the same directory where db2jcc.jar is,
sqllib\java.
If there is one, put the license jar file in her classpath,
db2jcc_license_cisuz.jar (for all servers).
Use db2jcc_license_cu.jar only to connect to luw servers.

I don't know if the trial edition comes with the license jar or not though.
</quote>

hope this helps.
Dave.

xixi wrote:

>hello
>
>i do have db2jcc.jar from fp2, but when i use it to get connection, i
>got the error
>
>com.ibm.db2.jcc.c.SqlException: The version of the IBM Universal JDBC
>driver in use is not licensed for connectivity to DB2 for Unix/Windows
>databases. To connect to this DB2 server, please obtain a licensed
>copy of the IBM DB2 Universal Driver for JDBC and SQLJ.
>
>we are just using trial edition of db2 udb server.
>
>so that is why i have to use db2jcc.jar from fp1. so can i use this
>version to solve my problem? thanks
>
>sharpe@us.ibm.com wrote in message news:<3EFCE642.9080304@us.ibm.com>...
>
>>Hi xixi,
>>Sherry tells me:
>>
>> From the trace it looks like you are using the Driver from FP1,
>>[ibm][db2][jcc][Connection@8c436b] Driver version: 1.1.67.
>>
>>FP2 would be "1.2.XX". You may have download FP2 but failed to point
>>her classpath to it.
>>Find out where your fp2 db2jcc.jar is and set classpath to it.
>>
>>set classpath=c:\blah\db2jcc.jar;%classpath%
>>
>>xixi wrote:
>>
>>>hi, i am using db2 v8.1 udb fix pack 2 on NT. db2jcc.jar is the jdbc
>>>driver we use, it is type 4. the url is
>>>
>>>DB_URL=jdbc:db2://xxx.xx.x.xx:50000/xxx
>>>
>>>as i look , sensitive resultset and updatable resultset is supported
>>>for type 4.
>>>
>>>
>>>from this url

>>
>>>http://www-3.ibm.com/software/data/d...a/r0010294.htm
>>>
>>>so would you please do the test from your side? thanks
>>>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 02-26-2008, 09:56 AM
sharpe@us.ibm.com
 
Posts: n/a
Default Re: ResultSet is not updatable.

Hi xixi,
I don't think it does, you need the fixpak2 for that.

xixi wrote:

>hello,
>
>i do put the db2jcc_license_cisuz.jar in the classpath, but still not
>work, i just want to know whether db2jcc.jar from fixpack1 support
>positioned update (or delete) ? (updateObject() method, updateRow()
>method)
>


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 02-26-2008, 10:13 AM
xixi
 
Posts: n/a
Default Re: ResultSet is not updatable.

hello, I was able to use db2jcc.jar fixpack2 to run the program now,
but still interfere with errors.

What I do is use a select query to position the cursor, then do a
resultset.updateObject(), so far no problem, then I do a
resultset.updateRow(), I got error code 798, I don't know why.

The sql is select id, brnum, ITMNUM, DESC from DDAI.NOINDEX_TABLE
where id = 8

id is identity column, but my updateobject() doesn't update id field,
but desc field. Please see the log. thanks
DriverManager.getConnection("jdbc:db2://172.16.4.10:50000/hd1100pd:traceFile=c:/foobar.txt;traceLevel=550;")
trying driver[className=com.ibm.as400.access.AS400JDBCDriver,AS/400
Toolbox for Java JDBC Driver]
trying driver[className=com.ibm.db2.jcc.DB2Driver,com.ibm.db2.jc c.DB2Driver@1db7df8]
[ibm][db2][jcc] BEGIN TRACE_CONNECTS
[ibm][db2][jcc] Attempting connection to 172.16.4.10:50000/hd1100pd
[ibm][db2][jcc] Using properties: { traceLevel=550,
traceFile=c:/foobar.txt, user=ddai, password=<escaped> }
[ibm][db2][jcc] END TRACE_CONNECTS
[ibm][db2][jcc][Connection@adb1d4] BEGIN TRACE_CONNECTS
[ibm][db2][jcc][Connection@adb1d4] Successfully connected to server
jdbc:db2://172.16.4.10:50000/hd1100pd
[ibm][db2][jcc][Connection@adb1d4] User: ddai
[ibm][db2][jcc][Connection@adb1d4] Database product name: DB2/NT
[ibm][db2][jcc][Connection@adb1d4] Database product version: SQL08012
[ibm][db2][jcc][Connection@adb1d4] Driver name: IBM DB2 JDBC Universal
Driver Architecture
[ibm][db2][jcc][Connection@adb1d4] Driver version: 1.2.117
[ibm][db2][jcc][Connection@adb1d4] DB2 Correlator:
AC100436.GE38.00F6675277DF
[ibm][db2][jcc][Connection@adb1d4] END TRACE_CONNECTS
[ibm][db2][jcc][t4] DRDA manager levels: { SQLAM=7, AGENT=7,
CMNTCPIP=5, RDB=7, SECMGR=6 }
getConnection returning
driver[className=com.ibm.db2.jcc.DB2Driver,com.ibm.db2.jc c.DB2Driver@1db7df8]
[ibm][db2][jcc][Thread:main][Statement@1b60280] executeQuery (select
NAME from sysibm.sysschemata where name = 'DDAI') called
[ibm][db2][jcc][Thread:main][Statement@1b60280] executeQuery ()
returned ResultSet@1d0fafc
[ibm][db2][jcc][Thread:main][ResultSet@1d0fafc] next () called
[ibm][db2][jcc][Thread:main][ResultSet@1d0fafc] next () returned true
[ibm][db2][jcc][Thread:main][PreparedStatement@f6438d] setString (1,
NOINDEX_TABLE) called
[ibm][db2][jcc][Thread:main][PreparedStatement@f6438d] executeQuery ()
called
[ibm][db2][jcc][Thread:main][PreparedStatement@f6438d] executeQuery ()
returned ResultSet@1eb2c1b
[ibm][db2][jcc][Thread:main][ResultSet@1eb2c1b] next () called
[ibm][db2][jcc][Thread:main][ResultSet@1eb2c1b] next () returned true
[ibm][db2][jcc][Thread:main][ResultSet@1eb2c1b] getString (DBKFLD)
called
[ibm][db2][jcc][Thread:main][ResultSet@1eb2c1b] getString (2) called
[ibm][db2][jcc][Thread:main][ResultSet@1eb2c1b] getString () returned
BRNUM
[ibm][db2][jcc][Thread:main][ResultSet@1eb2c1b] getString (DBKORD)
called
[ibm][db2][jcc][Thread:main][ResultSet@1eb2c1b] getString (3) called
[ibm][db2][jcc][Thread:main][ResultSet@1eb2c1b] getString () returned
A
[ibm][db2][jcc][Thread:main][ResultSet@1eb2c1b] next () called
[ibm][db2][jcc][Thread:main][ResultSet@1eb2c1b] next () returned false
[ibm][db2][jcc][Thread:main][PreparedStatement@1632847] setString (1,
DDAI) called
[ibm][db2][jcc][Thread:main][PreparedStatement@1632847] setString (2,
NOINDEX_TABLE) called
[ibm][db2][jcc][Thread:main][PreparedStatement@1632847] executeQuery
() called
[ibm][db2][jcc][Thread:main][PreparedStatement@1632847] executeQuery
() returned ResultSet@e95a56
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] next () called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] next () returned true
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString (COLTYPE)
called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString (2) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString () returned
INTEGER
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getInt (LENGTH) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getInt (4) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getInt () returned 4
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString (NAME) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString (1) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString () returned
BRNUM
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] next () called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] next () returned true
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString (COLTYPE)
called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString (2) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString () returned
INTEGER
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getInt (LENGTH) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getInt (4) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getInt () returned 4
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString (NAME) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString (1) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString () returned
ITMNUM
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] next () called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] next () returned true
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString (COLTYPE)
called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString (2) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString () returned
VARCHAR
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getInt (LENGTH) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getInt (4) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getInt () returned 20
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString (NAME) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString (1) called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] getString () returned
DESC
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] next () called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] next () returned false
[ibm][db2][jcc][Thread:main][Statement@1b60280] close () called
[ibm][db2][jcc][Thread:main][ResultSet@e95a56] close () called
[ibm][db2][jcc][Thread:main][PreparedStatement@1632847] close ()
called
[ibm][db2][jcc][Thread:main][Statement@1ffc686] executeQuery (select
id, brnum, ITMNUM, DESC from DDAI.NOINDEX_TABLE WHERE brnum=4 ORDER
BY brnum ASC) called
[ibm][db2][jcc][Thread:main][Statement@1ffc686] executeQuery ()
returned ResultSet@961dff
[ibm][db2][jcc][Thread:main][ResultSet@961dff] isBeforeFirst () called
[ibm][db2][jcc][Thread:main][ResultSet@961dff] isBeforeFirst ()
returned true
[ibm][db2][jcc][Thread:main][ResultSet@961dff] next () called
[ibm][db2][jcc][Thread:main][ResultSet@961dff] isAfterLast () called
[ibm][db2][jcc][Thread:main][ResultSet@961dff] isAfterLast () returned
false
[ibm][db2][jcc][Thread:main][ResultSet@961dff] next () returned true
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getObject (brnum)
called
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getObject (2) called
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getObject () returned 4
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getObject (ITMNUM)
called
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getObject (3) called
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getObject () returned 5
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getObject (DESC) called
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getObject (4) called
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getObject () returned
5th Item
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getObject (id) called
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getObject (1) called
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getObject () returned 8
[ibm][db2][jcc][Thread:main][Statement@1aaf0b3] executeQuery (select
id, brnum, ITMNUM, DESC from DDAI.NOINDEX_TABLE where id = 8) called
[ibm][db2][jcc][Thread:main][Statement@1aaf0b3] executeQuery ()
returned ResultSet@1a082e2
[ibm][db2][jcc][Thread:main][ResultSet@1a082e2] getConcurrency ()
returned 1008
[ibm][db2][jcc][Thread:main][ResultSet@1a082e2] next () called
[ibm][db2][jcc][Thread:main][ResultSet@1a082e2] isAfterLast () called
[ibm][db2][jcc][Thread:main][ResultSet@1a082e2] isAfterLast ()
returned false
[ibm][db2][jcc][Thread:main][ResultSet@1a082e2] next () returned true
[ibm][db2][jcc][Thread:main][ResultSet@961dff] getConcurrency ()
returned 1007
[ibm][db2][jcc][Thread:main][ResultSet@961dff] updateObject (desc,
Fifth Item) called
[ibm][db2][jcc][Thread:main][ResultSet@961dff] updateObject (4, Fifth
Item) called
SQLException: SQLState(null) vendor code(-99999)
com.ibm.db2.jcc.c.SqlException: ResultSet is not updatable.
at com.ibm.db2.jcc.c.cc.i(cc.java:3000)
at com.ibm.db2.jcc.c.cc.updateObject(cc.java:2078)
at com.ibm.db2.jcc.c.cc.updateObject(cc.java:2204)
at com.mincron.framework.translated.file.db.AS400Curs or.updateObject(AS400Cursor.java:156)
at com.mincron.framework.translated.file.db.DB2DbFile .resultSetUpdate(DB2DbFile.java:2669)
at com.mincron.framework.translated.file.db.DB2DbFile .updat(DB2DbFile.java:2494)
at com.mincron.framework.translated.file.db.Db2DbFile Tester1.chain_Test(Db2DbFileTester1.java:179)
at com.mincron.framework.translated.file.db.Db2DbFile Tester1.main(Db2DbFileTester1.java:34)
[ibm][db2][jcc] BEGIN TRACE_DIAGNOSTICS
[ibm][db2][jcc][SQLException@210b5b] java.sql.SQLException
[ibm][db2][jcc][SQLException@210b5b] SQL state = null
[ibm][db2][jcc][SQLException@210b5b] Error code = -99999
[ibm][db2][jcc][SQLException@210b5b] Message = ResultSet is not
updatable.
[ibm][db2][jcc][SQLException@210b5b] Stack trace follows
com.ibm.db2.jcc.c.SqlException: ResultSet is not updatable.
at com.ibm.db2.jcc.c.cc.i(cc.java:3000)
at com.ibm.db2.jcc.c.cc.updateObject(cc.java:2078)
at com.ibm.db2.jcc.c.cc.updateObject(cc.java:2204)
at com.mincron.framework.translated.file.db.AS400Curs or.updateObject(AS400Cursor.java:156)
at com.mincron.framework.translated.file.db.DB2DbFile .resultSetUpdate(DB2DbFile.java:2669)
at com.mincron.framework.translated.file.db.DB2DbFile .updat(DB2DbFile.java:2494)
at com.mincron.framework.translated.file.db.Db2DbFile Tester1.chain_Test(Db2DbFileTester1.java:179)
at com.mincron.framework.translated.file.db.Db2DbFile Tester1.main(Db2DbFileTester1.java:34)
[ibm][db2][jcc] END TRACE_DIAGNOSTICS
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:10 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com