Class StringTrimmedResultSet

java.lang.Object
org.apache.commons.dbutils.wrappers.StringTrimmedResultSet
All Implemented Interfaces:
InvocationHandler

public class StringTrimmedResultSet extends Object implements InvocationHandler
Wraps a ResultSet to trim strings returned by the getString() and getObject() methods.

Usage Example: This example shows how to decorate ResultSets so processing continues as normal but all Strings are trimmed before being returned from the ResultSet.

 ResultSet rs = // somehow get a ResultSet;

 // Substitute wrapped ResultSet with additional behavior for real ResultSet
 rs = StringTrimmedResultSet.wrap(rs);

 // Pass wrapped ResultSet to processor
 List list = new BasicRowProcessor().toBeanList(rs);
 
  • Field Details

    • factory

      private static final ProxyFactory factory
      The factory to create proxies with.
    • rs

      private final ResultSet rs
      The wrapped result.
  • Constructor Details

    • StringTrimmedResultSet

      public StringTrimmedResultSet(ResultSet rs)
      Constructs a new instance of StringTrimmedResultSet to wrap the specified ResultSet.
      Parameters:
      rs - ResultSet to wrap
  • Method Details