You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by sy...@apache.org on 2002/12/01 22:19:58 UTC

cvs commit: xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source BlobSource.java

sylvain     2002/12/01 13:19:58

  Modified:    src/scratchpad/src/org/apache/cocoon/components/source Tag:
                        cocoon_2_0_3_branch BlobSource.java
  Log:
  Handle more column types
  
  Revision  Changes    Path
  No                   revision
  
  
  No                   revision
  
  
  1.2.2.1   +9 -4      xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/BlobSource.java
  
  Index: BlobSource.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/scratchpad/src/org/apache/cocoon/components/source/BlobSource.java,v
  retrieving revision 1.2
  retrieving revision 1.2.2.1
  diff -u -r1.2 -r1.2.2.1
  --- BlobSource.java	3 Apr 2002 12:22:11 -0000	1.2
  +++ BlobSource.java	1 Dec 2002 21:19:58 -0000	1.2.2.1
  @@ -120,7 +120,7 @@
           if (!url.startsWith("blob:/")) {
               throw new MalformedURLException("Malformed url for a blob source : " + url);
           }
  -        
  +
           this.systemId = url;
           
           // Parse the url
  @@ -202,9 +202,9 @@
               
               ResultSet rs = stmt.executeQuery(select);
               rs.next();
  -            
  +
               int colType = rs.getMetaData().getColumnType(1);
  -            
  +
               switch(colType) {
                   case Types.BLOB :
                       Blob blob = rs.getBlob(1);
  @@ -216,6 +216,11 @@
                       return new JDBCInputStream(clob.getAsciiStream(), cnx);
                   //break;
                   
  +                case Types.LONGVARBINARY :
  +                case Types.VARBINARY :
  +                    return new JDBCInputStream(rs.getBinaryStream(1), cnx);
  +                //break;
  +              	
                   default :
                       String value = rs.getString(1);
                       stmt.close();
  
  
  

----------------------------------------------------------------------
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