ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: Oracle function result sets with iBatis
Date Mon, 17 Jan 2005 20:17:18 GMT
Could you submit this in JIRA so it doesn't get lost?


Thanks
Clinton

On Sun, 16 Jan 2005 00:04:08 -0600, Ken Katsma <kenkatsma@gmail.com> wrote:
> Sure,  see my comments through the following....
> 
> I just added a check to see if the database was oracle
> 
>  if
> > (conn.getMetaData().getDatabaseProductName().equalsIgnoreCase("Oracle"))
> >       {
> 
> And if it is, then don't do a query, do an execute....
> 
> >  boolean b = cs.execute();
> >
> >  errorContext.setMoreInfo("In Oracle query mode.");
> >  errorContext.setMoreInfo("Check the output parameters
> >  (retrieval of output parameters failed).");
> 
> Grab the output parameters, and find the one that's a resultset.
> 
> >  retrieveOutputParameters(cs, mappings, parameters);
> >
> >  for (int i=0;i<parameters.length;i++)
> >  {
> >  if (parameters[i] instanceof ResultSet)
> >  {
> >  rs = (ResultSet) parameters[i];
> >  break;
> >  }
> >  }
> >
> 
> Then perform handle results...
> 
> >  errorContext.setMoreInfo("Check the results (failed to
> >  retrieve results).");
> >  handleResults(request, rs, skipResults, maxResults, callback);
> >  }
> 
> Otherwise, just do the traditional executeQuery.
> 
> >  else
> >  {
> >  errorContext.setMoreInfo("In non-Oracle mode.");
> >  rs = cs.executeQuery();
> >
> >  errorContext.setMoreInfo("Check the results (failed to retrieve
> >  results).");
> >  handleResults(request, rs, skipResults, maxResults, callback);
> >
> >  errorContext.setMoreInfo("Check the output parameters (retrieval
> >  of output parameters failed).");
> >  retrieveOutputParameters(cs, mappings, parameters);
> >  }
> >  } finally {
> >  try {
> >  closeResultSet(rs);
> >  } finally {
> >  closeStatement(cs);
> >  }
> >  }
> 
> If you need anything more let me know, thanks.
> 
> Clinton Begin wrote:
> 
> >Could you explain more clearly what you changed?
> >
> >Clinton
> >
> >
> >
> >
>

Mime
View raw message