• Post Reply Bookmark Topic Watch Topic
  • New Topic

Updatable ResultSet - getString works but getObject does not??

 
Shailan Mm
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am creating an updatable resultset and then going thru it to read the values in each row. When I use getObject() to get the column values for each row, I get nulls. However, when I use getString(), I get the correct values.
Also, if I create a regular statement, not using the updatable result set feature, the getObject() call works fine.

Why would this be happening? (code below)

Thanks
Shailan




[edited to add code tags]
[ December 07, 2004: Message edited by: Jeanne Boyarsky ]
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36005
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shailan,
What is the type of the database field? Also, what database are you using?
 
Shailan Mm
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeanne

Im using Oracle8i Enterprise Edition Release 8.1.6.0.0

The query does a select * from a table with the following field types. (all Nullable)

Type
------------
VARCHAR2(3)
VARCHAR2(5)
VARCHAR2(3)
VARCHAR2(6)
VARCHAR2(1)
VARCHAR2(6)
DATE
VARCHAR2(1)
VARCHAR2(2)
DATE
DATE
VARCHAR2(8)
VARCHAR2(20)
 
Jim Cheng
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is an interesting question.
I will try to duplicate the problem and figure out the reason if I have time.

Please also report back if you figure out the reason.


Jim
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36005
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Shailan,
Strange. You are using Oracle's JDBC driver, right?
 
Shailan Mm
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yup. oracle.jdbc.driver.OracleDriver.
 
Shailan Mm
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Has anyone else encountered this behavior?

Thanks
Shailan
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!