Forwarding a ResultSet object

You can use the steps below to forward results from a JDBC query directly to the client:

  1. Query the remote server. Use java.sql.Statement or one of its extensions; the appropriate method depends on the query being sent.

  2. Handle the results of the query. For each ResultSet returned by the query, call JContext.forwardResultSet(ResultSet) to forward the rows to the client.

  3. If your component uses IDL/Java datatypes, return null as the method’s return value.

For an example that calls JContext.forwardResultSet(ResultSet), see “Java Connection Manager example”. You can find more examples in the source for the EAServer sample Java components, available in your EAServer installation directory.

Instead of calling JContext.forwardResultSet(ResultSet), Java components that use IDL/Java datatypes can call the IDL.getResultSet(java.sql.ResultSet) method to convert ResultSet object to TabularResults.ResultSet object, then return the converted object as the method’s return value.