473,322 Members | 1,473 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

How to process data from column functions with UDB

First, don't spend much time in Java so hope this is not a really dumb question. I need to run a singleton select from user tables. I'm currently prototyping this using standard UDB catalog tables. I have code like the following:

ResultSet result1 = stmt.executeQuery(
"SELECT MAX(STMTNO), MIN(STMTNO), AVG(STMTNO)" +
"FROM SYSIBM.SYSSTMT WHERE ISOLATION < 'X'");
//
// get max/min/avg
//
if( result1.next() ) // get first row
{ // only one row
sHostvar1 = result1.getString("MAX");
sHostvar2 = result1.getString("MIN");
sHostvar3 = result1.getString("AVG");


* when I attempt to execute the above it returns: java.sql.SQLException: Column not found / what gives? I have other cursors where I am returning multiple rows and that all works well, just this one query.

Any help sincerely appreciated!
Apr 14 '07 #1
1 1138
JosAH
11,448 Expert 8TB
First, don't spend much time in Java so hope this is not a really dumb question. I need to run a singleton select from user tables. I'm currently prototyping this using standard UDB catalog tables. I have code like the following:

ResultSet result1 = stmt.executeQuery(
"SELECT MAX(STMTNO), MIN(STMTNO), AVG(STMTNO)" +
"FROM SYSIBM.SYSSTMT WHERE ISOLATION < 'X'");
//
// get max/min/avg
//
if( result1.next() ) // get first row
{ // only one row
sHostvar1 = result1.getString("MAX");
sHostvar2 = result1.getString("MIN");
sHostvar3 = result1.getString("AVG");


* when I attempt to execute the above it returns: java.sql.SQLException: Column not found / what gives? I have other cursors where I am returning multiple rows and that all works well, just this one query.

Any help sincerely appreciated!
Do columns "MAX", "MIN" and "AVG" exist? Use getString(int index) instead.

kind regards,

Jos
Apr 14 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Peter Åstrand | last post by:
There's a new PEP available: PEP 324: popen5 - New POSIX process module A copy is included below. Comments are appreciated. ---- PEP: 324 Title: popen5 - New POSIX process module
2
by: ecoulson123 | last post by:
I am using Access 2000. I am trying to summarize numeric data from a large database. The problem is that I need the summarization functions to ignore "junk" data, defined in a couple ways. ...
2
by: Tenacious | last post by:
I have been trying to run this program called mysqlbinlog.exe from my main c# application using the Process class(See example below). The way that mysqlbinlog functions is to read the first file in...
3
by: Robin Thomas | last post by:
I am fairly new to ASP.NET so I think I am missing something fundamental. Anyway, quite often I am pulling data from a database, but then I need to use that data to produce more data. A simple...
1
by: JJ | last post by:
Is it possible to count the number of columns that match certain conditions and return a single value? For example in the database we have a record where: Column 1 = Male Column 2 = A Column...
4
by: Hexman | last post by:
Hello All, I'd like to find out the best way to add a cb column to a dgv and process efficiently. I see at least two ways of doing it. ------------------------------- 1) Add a cb to the dgv,...
0
by: mix01 | last post by:
Hi, I am trying to get some VBA code working, but am preplex as to why it does not work. I would really appreciate any level of help. Many thanks, Mix01 Version of the program
60
by: harshal | last post by:
Hi all, Can we read the stack frame's of the current process. as we know that whenever a function call is made in c new functions stack frame is created and pushed on to the stack. and when the...
8
by: Ravi | last post by:
Hi to all, There is a start button in my page. if user clicks on that then a php program should start and should listen on a particular port. and also user should able to do other tasks on...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.