Share this page 

Pass a ResultSet to a JSP from a Bean(this howto is deprecated)Tag(s): DEPRECATED


Java ResultSet can't be passed directly, you need to convert it into a portable format. Sybase have included some classes to do the transformation. The ResultSet is converted into a TabularResults (which is a portable ResultSet format).

First, the Bean returns the ResultSet into TabularResults

import com.sybase.CORBA.jdbc11.*;

java.sql.ResultSet rs;
//  do your processing to obtain a ResultSet
//  then convert it
TabularResults.ResultSet trrs = IDL.getResultSet(rs);
return trrs;
then in the JSP, you can convert it back to a ResultSet
<%@ page import="com.sybase.CORBA.jdbc11.SQL" %>
...
TabularResults.ResultSet trrs;
...
java.sql.ResultSet resultset = SQL.getResultSet(trrs);