Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Fetch and return as array

Status
Not open for further replies.

cleanair4me

Technical User
May 16, 2008
61
I am trying to retrieve the results from a query of my Oracle 9i database. In every call it should retrieve a single row from the results and returns it as an array, where each field of the row is in an array key.



My attempt but it doesnt give me any data:
Code:
while (rs.next())
{
String res = stmt.executeQuery("select * from Customers where ID = 34"); 

String firstname = "";
String lastname = "";
String $inf []; 
if($inf.equals(getParameterValues($res)) { 
   out.write(inf[firstname]);
   out.write(inf[lastname]);
}
 

Please focus on this:
Code:
callableStatement.registerOutParameter(3,OracleTypes.ARRAY,"TYPE_STRING_ARRAY");
and related program code.
You could see the way to get the array from the code in the hyperlink.
There are only a few tutorials on the web for this topics.
Code:
Connection conn = ...
OracleCallableStatement cs = (OracleCallableStatement)conn.prepareCall ( "{...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top