cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From h...@apache.org
Subject cvs commit: xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/util JDBCTypeConversions.java
Date Fri, 31 Jan 2003 16:03:05 GMT
haul        2003/01/31 08:03:05

  Modified:    src/blocks/databases/java/org/apache/cocoon/util
                        JDBCTypeConversions.java
  Log:
  use getBoolean() for boolean columns
  
  Revision  Changes    Path
  1.7       +11 -11    xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/util/JDBCTypeConversions.java
  
  Index: JDBCTypeConversions.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/blocks/databases/java/org/apache/cocoon/util/JDBCTypeConversions.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- JDBCTypeConversions.java	21 Jan 2003 15:55:50 -0000	1.6
  +++ JDBCTypeConversions.java	31 Jan 2003 16:03:05 -0000	1.7
  @@ -91,7 +91,7 @@
    * <tr><td>big-decimal</td><td>BigDecimal  </td><td>
       </td><td>BigDecimal   </td></tr>
    * <tr><td>binary     </td><td>            </td><td>
       </td><td>BinaryStream </td></tr>
    * <tr><td>blob       </td><td>            </td><td>
       </td><td>Blob         </td></tr>
  - * <tr><td>boolean    </td><td>Bit         </td><td>Integer
</td><td>Boolean      </td></tr>
  + * <tr><td>boolean    </td><td>Boolean  </td><td>Boolean
</td><td>Boolean      </td></tr>
    * <tr><td>byte       </td><td>Byte        </td><td>Byte
   </td><td>Byte         </td></tr>
    * <tr><td>string     </td><td>String      </td><td>
       </td><td>String       </td></tr>
    * <tr><td>date       </td><td>Date        </td><td>
       </td><td>Date         </td></tr>
  @@ -235,7 +235,7 @@
               value = set.getArray(dbcol); // new Integer(set.getInt(dbcol));
               break;
           case Types.BIT:
  -            value = new Integer(set.getInt(dbcol));
  +            value = new Boolean(set.getBoolean(dbcol));
               break;
           case Types.STRUCT:
               value = (Struct) set.getObject(dbcol);
  @@ -528,16 +528,16 @@
               } else if (value instanceof FilePart) {
                   statement.setBinaryStream(position, ((FilePart)value).getInputStream(),
((FilePart)value).getSize());
               } else {
  -                if (value instanceof File) {
  -                    file = (File)value;
  -                } else if (value instanceof String) {
  -                    file = new File((String)value);
  -                } else {
  -                    throw new SQLException("Invalid type for blob: "+value.getClass().getName());
  +                if (value instanceof File) {           
  +                   file = (File)value;
  +               } else if (value instanceof String) {
  +                   file = new File((String)value);
  +               } else {
  +                   throw new SQLException("Invalid type for blob: "+value.getClass().getName());
                   }
  -                //InputStream input = new BufferedInputStream(new FileInputStream(file));
  -                FileInputStream input = new FileInputStream(file);
  -                statement.setBinaryStream(position, input, (int)file.length());
  +                 //InputStream input = new BufferedInputStream(new FileInputStream(file));
  +                 FileInputStream input = new FileInputStream(file);
  +                 statement.setBinaryStream(position, input, (int)file.length());
               }
               break;
           case Types.INTEGER:
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org


Mime
View raw message