Statement (strSQL) is supposed to return the maximun sequence number generated and i'm trying to print it out on the jsp... i think i'm messing up on the while.next... the max number is declared as an int.
What's the problem that you are facing? Are you getting exceptions? or the code executes but doesn't give any result
The only problem that I see is that if executeQuery generates an exception, rs will be null. You might want to move all your code inside a single try-catch block. That would save a lot of unnessescary operations and make your log much cleaner
Also, if you dont have any records in complainant, then nothing will come on the screen.
thanks for the response... i've done just that but no luck... the code execute fine but no number is generated. when i run my SQL statement(strSQL) on SQL navigator it works fine cos i do get the max number but on the jsp i dont .
thanks for the response once again, i think the connection is fine. what i do is , i insert into a table using sequence(sequence.nextval) as primary key then i select the maximum number(current value)and use this as the reference number. i then try to generate this number on my jsp but the number is not printed.
Is this problem solved? If not, can you furnish what info is logged? My instinct tells me there is an exception somewhere that you overlook.
Probably the ResultSet is closed when you try to access it. Did you close the PreparedStatement anywhere in your code. Check that out. If you close the PreparedStatement, the ResultSet automatically gets closed.