Currently, I have an application, using Statement::getXXX methods. I'll rewrite it and add new features.
But with the new design, it would be better to use ResultSet::getXXX methods.
Will they give me the same behavior, is there anything special or any differences between these methods?
My guess is, that class StatementImpl holds a pointer to the ResultSet and calls its methods (after 'executeXXX' is called), but it's just a blind guess.
Thank you in advance!
Edited by: Kiril Kirov on Jan 19, 2012 12:18 PM
Edited by: Kiril Kirov on Jan 19, 2012 12:27 PM
There aren't any common getXX functions across Connection & ResultSet Class.
Each of them are meant to be with a purpose and cannot be replaced with others.
getXXX methods of Connection Class are to be used to get values of certain attributes of an active Connection
getXXX methogs of ResultSet Class are to be used to fetch results and values of certain attributes of ResultSet.
Sorry, sorry, my bad, I'm still sleeping..
I fixed my question... I wanted to ask about ResultSet and **Statement** (after execute is called), **NOT** class Connection..
Edited by: Kiril Kirov on Jan 19, 2012 12:30 PM
getXXX methods of Statement and ResultSet are for different purpose and cannot be interchaged.
If a statement is a query which returns a resultset then you have to use the getXXX methods of ResultSet class to fetch the data.
If you are executing a pl/sql procedure then after the statement has been executed you need to use the getXXX methods of Statement Class to fetch the results.
Edited by: Sudheendra on Jan 19, 2012 4:29 PM
Thank you very much for the clear and fast answers!
Marked as answered + "helpful" + "correct" marks.
Edited by: Kiril Kirov on Jan 19, 2012 1:03 PM
Edited by: Kiril Kirov on Jan 19, 2012 1:04 PM