You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by dg...@apache.org on 2003/10/15 04:26:41 UTC

cvs commit: jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/driver StringTrimmedResultSet.java

dgraham     2003/10/14 19:26:41

  Modified:    dbutils/src/java/org/apache/commons/dbutils/driver
                        StringTrimmedResultSet.java
  Log:
  Removed references to Commons Lang StringUtils.trim() to remove the 
  dependency on that package.
  
  Revision  Changes    Path
  1.3       +16 -10    jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/driver/StringTrimmedResultSet.java
  
  Index: StringTrimmedResultSet.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/driver/StringTrimmedResultSet.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StringTrimmedResultSet.java	12 Oct 2003 09:37:28 -0000	1.2
  +++ StringTrimmedResultSet.java	15 Oct 2003 02:26:41 -0000	1.3
  @@ -1,7 +1,10 @@
  -
  -package org.apache.commons.dbutils.driver;
  -
  -/* ====================================================================
  +/* 
  + * $Header$
  + * $Revision$
  + * $Date$
  + * 
  + * ====================================================================
  + * 
    * The Apache Software License, Version 1.1
    *
    * Copyright (c) 2003 The Apache Software Foundation.  All rights
  @@ -55,10 +58,11 @@
    * <http://www.apache.org/>.
    */
   
  +package org.apache.commons.dbutils.driver;
  +
   import java.sql.ResultSet;
   import java.sql.SQLException;
   import java.sql.Statement;
  -import org.apache.commons.lang.StringUtils;
   
   /**
    * Wraps a <code>ResultSet</code> to trim strings returned by the
  @@ -68,6 +72,7 @@
    * @version $Id$
    */
   public class StringTrimmedResultSet extends ResultSetWrapper {
  +    
       private ResultSet rs = null;
       
       /**
  @@ -81,8 +86,7 @@
       }
   
       /**
  -     * Constructs a new instance of
  -     * <code>StringTrimmedResultSet</code>.
  +     * Constructs a new instance of <code>StringTrimmedResultSet</code>
        * to wrap the specified <code>ResultSet</code> and <code>Statement</code>.
        */
       public StringTrimmedResultSet(ResultSet rs, Statement st) {
  @@ -102,7 +106,8 @@
        * @throws SQLException if a database access error occurs
        */
       public String getString(String column) throws SQLException {
  -        return StringUtils.trim(this.rs.getString(column));
  +        String value = this.rs.getString(column);
  +        return (value == null) ? null : value.trim();
       }
       
       /**
  @@ -117,6 +122,7 @@
        * @throws SQLException if a database access error occurs
        */
       public String getString(int idx) throws SQLException {
  -        return StringUtils.trim(this.rs.getString(idx));
  +        String value = this.rs.getString(idx);
  +        return (value == null) ? null : value.trim();
       }
   }
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org