commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bay...@apache.org
Subject cvs commit: jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/driver/enhanced EnhancedCallableStatement.java EnhancedPreparedStatement.java
Date Mon, 11 Nov 2002 15:50:45 GMT
bayard      2002/11/11 07:50:45

  Modified:    dbutils/src/java/org/apache/commons/dbutils/driver/enhanced
                        EnhancedCallableStatement.java
                        EnhancedPreparedStatement.java
  Log:
  Added in primitive wrappers for these classes.
  
  Revision  Changes    Path
  1.2       +29 -0     jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/driver/enhanced/EnhancedCallableStatement.java
  
  Index: EnhancedCallableStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/driver/enhanced/EnhancedCallableStatement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EnhancedCallableStatement.java	11 Nov 2002 03:16:38 -0000	1.1
  +++ EnhancedCallableStatement.java	11 Nov 2002 15:50:45 -0000	1.2
  @@ -3,6 +3,7 @@
   import java.sql.CallableStatement;
   import java.sql.ResultSet;
   import java.sql.Connection;
  +import java.sql.SQLException;
   
   import org.apache.commons.dbutils.driver.CallableStatementWrapper;
   
  @@ -15,6 +16,34 @@
       
       protected ResultSet wrap(ResultSet rs) {
           return new EnhancedResultSet(rs, this);
  +    }
  +
  +    public Boolean getBooleanObject(int idx) throws SQLException {
  +        return new Boolean(getBoolean(idx));
  +    }
  +
  +    public Byte getByteObject(int idx) throws SQLException {
  +        return new Byte(getByte(idx));
  +    }
  +
  +    public Short getShortObject(int idx) throws SQLException {
  +        return new Short(getShort(idx));
  +    }
  +
  +    public Integer getIntegerObject(int idx) throws SQLException {
  +        return new Integer(getInt(idx));
  +    }
  +
  +    public Float getFloatObject(int idx) throws SQLException {
  +        return new Float(getFloat(idx));
  +    }
  +
  +    public Double getDoubleObject(int idx) throws SQLException {
  +        return new Double(getDouble(idx));
  +    }
  +
  +    public Long getLongObject(int idx) throws SQLException {
  +        return new Long(getLong(idx));
       }
   
   }
  
  
  
  1.2       +29 -0     jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/driver/enhanced/EnhancedPreparedStatement.java
  
  Index: EnhancedPreparedStatement.java
  ===================================================================
  RCS file: /home/cvs/jakarta-commons-sandbox/dbutils/src/java/org/apache/commons/dbutils/driver/enhanced/EnhancedPreparedStatement.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- EnhancedPreparedStatement.java	11 Nov 2002 03:16:38 -0000	1.1
  +++ EnhancedPreparedStatement.java	11 Nov 2002 15:50:45 -0000	1.2
  @@ -3,6 +3,7 @@
   import java.sql.PreparedStatement;
   import java.sql.ResultSet;
   import java.sql.Connection;
  +import java.sql.SQLException;
   
   import org.apache.commons.dbutils.driver.PreparedStatementWrapper;
   
  @@ -15,6 +16,34 @@
       
       protected ResultSet wrap(ResultSet rs) {
           return new EnhancedResultSet(rs, this);
  +    }
  +
  +    public void setBooleanObject(int idx, Boolean b) throws SQLException {
  +          setBoolean(idx, (b == null)?false:b.booleanValue() );
  +    }
  +
  +    public void setByteObject(int idx, Byte b) throws SQLException {
  +          setByte(idx, (b == null)?0:b.byteValue() );
  +    }
  +
  +    public void setShortObject(int idx, Short s) throws SQLException {
  +          setShort(idx, (s == null)?0:s.shortValue() );
  +    }
  +
  +    public void setIntegerObject(int idx, Integer i) throws SQLException {
  +          setInt(idx, (i == null)?0:i.intValue() );
  +    }
  +
  +    public void setFloatObject(int idx, Float f) throws SQLException {
  +          setFloat(idx, (f == null)?0.0F:f.floatValue() );
  +    }
  +
  +    public void setDoubleObject(int idx, Double d) throws SQLException {
  +          setDouble(idx, (d == null)?0.0:d.doubleValue() );
  +    }
  +
  +    public void setLongObject(int idx, Long lng) throws SQLException {
  +          setLong(idx, (lng == null)?0L:lng.longValue() );
       }
   
   }
  
  
  

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


Mime
View raw message