Hi Guys. If i run a simple query that returns 5 records each with a column as follows : select * from tableName ..... returns: row1 = aaa row2 = bbb row3 = ccc row4 = ddd row5 = eee Question : How do i get just a String from the resultset .Which means concatenating all the records on the database and returning just one String object from my resultset. Hence desired result: String x =aaa + bbb + ccc + ddd + eee ; All codes and references will be appreciated NOTE : my actual logic is returning 1000s of records with say 5 columns each and i need all as an object from a query on an Oracle back end.I donot have a clue how to go about this.
Hi, You can do one more thing, in your sql statement concatenate all the columns so that you get one column and then rs.getString(1) will give you string of all the five columns snippet: select col1 || col2 || col3 || col4 || col5 somename from table; and now as Jamie has given the code append the each row in the result to a stringbuffer object. Hope this helps Kareem
Joined: Mar 14, 2002
Hi, I am sorry i misread your question. You are talking about the rows. Kareem