From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-
bounces@xxxxxxxxxxxx] On Behalf Of James H. H. Lampert
Sent: Wednesday, July 10, 2013 6:04 PM
To: 'Java Programming on and around the IBM i'
Subject: Hmm. Now how to get the data from the JDBC connection into a
form we can use . . .
Some thoughts and musings. Comments from the peanut gallery would be
One thought I had was to expose and wrap the remaining ResultSet.getxxxx
methods that weren't already exposed in JDBCR4.
Then I noticed the ResultSet.getBytes() method: running an actual Java
program calling JDBC on DB2/400, I get the correct raw bytes for both
zoned and packed (and the raw bytes for character fields even come up as
Then I realized that the method wouldn't necessarily produce anything
directly usable for databases other than DB2/400. And to that end, I
replicated our familiar VIEWCUS PF in MySQL. Damn: for both "Numeric"
and "Decimal" fields, getBytes on a MySQL database yields ASCII digits,
with leading zeros truncated off, and actual ASCII minus signs and/or
decimal points among the digits.
Interesting: getObject() on a Numeric field that doesn't have any
decimal places yields an Integer, but on a Decimal field with no decimal
places, it yields a BigDecimal.
Given that I haven't a clue how to deal with a BigDecimal in ILE or OPM
RPG, much less in OPM MI, I'm thinking that the simplest solution for
the problem at hand is to get everything as a string, and convert it
into whatever form it SHOULD be in.
But it also looks like JDBCR4, so far, has not exposed any of the
methods for updating through a result set.
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.