Shailan Mm

Greenhorn
+ Follow
since Oct 06, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Shailan Mm

Has anyone else encountered this behavior?

Thanks
Shailan
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)
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 ]
Thanks Jeanne, and sorry for the cross post in the beginners forum.
Hi

I was wondering what the common ways to store the results of a JDBC query were. I have recently migrated from Perl, and am used to storing the results in a hash. Is there a similar data structure that can easily handle the results of the query. I have tried HashMap, but cant figure out how to get a key to map to another HashMap internally without explicitly creating the internal HashMaps first.

E.g.
The query is something like this:
select animal, type, name from animals;

and the result set is:

Animal Type Name
dog husky Bella
dog poodle Alfie
cat manc Gus

I want the data structure to look like this:

dog => {husky => Bella, poodle => Alfie}
cat => {manc => Gus}

that is:
1) 2 top level keys - dog and cat
2) the 'dog' key pointing to another HashMap which itself has 2 keys - husky and poodle, with the value for husky being Bella and the value for poodle, Alfie
3) the 'cat' key pointing to another HashMap containing one key-value pair, manc => Gus


Alternatively, is there some better way to store the results rather than trying to duplicate Perl hashes?

Thank you
Shailan
To clarify (the formatting got messed up)

I want the data structure to have:

1) 2 top level keys - dog and cat
2) the 'dog' key pointing to another HashMap which itself has 2 keys - husky and poodle, with the value for husky being Bella and the value for poodle, Alfie
3) the cat key having a value Gus

Sorry to belabor the point, but the graphical representation i tried to give was not clear. It looked like I wanted to make poodle a top level key, which is not the case

Thanks
Shailan
19 years ago
Hi

I was wondering what the common ways to store the results of a JDBC query were. I have recently migrated from Perl, and am used to storing the results in a hash. Is there a similar data structure that can easily handle the results of the query. I have tried HashMap, but cant figure out how to get a key to map to another HashMap internally without explicitly creating the internal HashMaps first.

E.g.
The query is something like this:
select animal, type, name from animals;

and the result set is:

Animal Type Name
dog husky Bella
dog poodle Alfie
cat manc Gus

I want the data structure to look like this:

dog => husky => Bella
poodle => Alfie
cat => manc => Gus


Alternatively, is there some better way to store the results rather than trying to duplicate Perl hashes?

Thank you
Shailan
19 years ago