• Post Reply Bookmark Topic Watch Topic
  • New Topic

resultset question..urgent..

 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,
i am passing a vector containing a resultset from my servlet to my frame,now in the frame i obviously want to retrieve the resultset from the vector.but the problem is that the vector stores the resultset as an object,so can somebody please tell me how to convert the resultset stored in the vector as an object to type resultset and hence extract it...i would really appreciate it..
regards
karan
 
Trevor Dunn
Ranch Hand
Posts: 84
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just cast it back to resultset
Vector v = new Vector();
ResultSet rs = (ResultSet)v.elementAt(0);
Trevor
 
Desai Sandeep
Ranch Hand
Posts: 1157
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As suggested by Tevor, you may cast the Object into the ResultSet and then use the normal JDBC statements to iterate through the ResultSet.However you should know the index of the object in the Vector for casting it, otherwise you may get ClassCastException!
Hope this helps,
Sandeep
SCJP2, OCSD(Oracle JDeveloper), OCED(Oracle Internet Platform)
 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot trevor and sandeep..things are working now..
regards
karan
 
karan, chopra
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi guys,
as u must have read above,i am trying to pass a resultset in a vector from a servlet to a frame,but on executing the program i am getting the following exception:
java.io.NotSerializableException: sun.jdbc.odbc.JdbcOdbcResultSet
does this mean that a vector containing a resultset cannot be passed from a servlet to a frame because a resultset is not serilizable?if yes then how should i pass the data that i want to be displayed by the resultset to the frame?
please help ASAP,i would appreciate it..
regards
karan
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!