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);
  • Constructor Details

    • StringTrimmedResultSet

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