Zend v2 + oracle 10 + blob problem

Hi all,
I have a problem with display an images. Script looks like that:
<?
$myblobid = 1;
$conn = oci_connect('tmp', 'tmp','db');
$query = 'select * from photos_blob where id=:MYBLOBID';
$stmt = oci_parse ($conn, $query);
oci_bind_by_name($stmt, ':MYBLOBID', $myblobid);
oci_execute($stmt);
$arr = oci_fetch_assoc($stmt);
$result = $arr['photo']->load();
header("Content-type: image/jpeg");
echo $result;
oci_free_statement($stmt);
oci_close($conn);
?>
and I can not see a picture. I believe that this script works good because when I delete a "header("Content-type: image/jpeg");" i see a binary data.
Any ideas?
Best regards.

You have posted your question to an inappropriate group.
Please review the list of topics and choose more wisely. <g>

Similar Messages

  • Tomcat 4.1 Oracle Blob problem using apache commons DBCP

    Hi all,
    We are using Tomcat 4.1.12, Java 1.4.x and trying to take advantage of the connection pooling that comes with Tomcat(the apache commons DBCP).
    We are connecting to a oracle database.
    Works fine for everything EXCEPT Blobs. We have a servlet that serves images from Oracle, that works fine when it doesn't use the connection pooling, but throws an exception when we call the
    ERROR: Class:DisplayGraphic Method:processRequest(HttpServletRequest request, Ht
    tpServletResponse response)
    Exception: org.apache.commons.dbcp.DelegatingResultSet
    DataSource ds = (DataSource)ctx.lookup("jdbc/db_connection");
    Connection conn = ds.getConnection();
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    pstmt = conn.prepareStatement("SELECT graphic FROM graphics WHERE graphic_id = 1");
    rs = pstmt.executeQuery();
    if(rs.next())
        oracle.sql.BLOB oBlob = ((OracleResultSet) oRS).getBLOB("GRAPHIC");
        InputStream oIS =  oBlob.getBinaryStream();
        ... etc etc...
    }Any ideas?
    Cheers,
    Alex.

    solved the problem.. i was using getBLOB instead of
    getBlob
    doh..Hi Alex,
    your problem is very interesting for me because I have a similar problem and your identical configuration...
    the instruction
    oracle.slq.BLOB aBlob = ((OracleResultSet)super.mRs).getBLOB("BLOBBONE")
    causes this:
    java.lang.ClassCastException: org.apache.commons.dbcp.DelegatingResultSet
    To resolve this, I changed, in server.xml , the factory
    <parameter>
                        <name>factory</name>
                        <value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
                   </parameter>
    with:
    <parameter>
    <name>factory</name>
    <value>oracle.jdbc.pool.OracleDataSourceFactory</value>
    </parameter>          
    and magically all works fine...
    But the question is... Why doesn't it work with the standard factory???
    There is a problem in the CLASSPATH that I don't see?
    Any suggestions is welcome!
    Thanks in advance!
    Giselda

  • Oracle BLOB problem...pls help if possible

    I have been having trouble with my JSP code using the Tomcat server. I've finally gotten the compiler to recognize my result set as an Oracle Result set without it giving me casting errors. Here is part of my code:
    %@ page import="oracle.sql.*"%>
    <%@ page import="oracle.sql.BLOB"%>
    <%@ page import="oracle.jdbc.driver.*"%>
    <%@ page import="oracle.jdbc.driver.OracleResultSet"%>
    <%@ page import="java.lang.Object.*"%>
    <%@ page import="java.sql.*"%>
    <%@ page import="java.io.*"%>
    <body bgcolor="navajowhite">
    <%
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    Connection con = DriverManager.getConnection("jdbc:odbc:Andy","system","pass");
    //con.setAutoCommit(false);
    Statement myStatement = null;
    String sourceDirectory = "D:\\Tomcat\\jakarta-tomcat-4.0.3\\webapps\\Root\\Mproject\\";
    String fileName = sourceDirectory + "Test.doc";
    String SS = "222-22-2222";
    myStatement.executeUpdate("INSERT INTO LI.TEST (ID, FILE_NAME, BLOB_COLUMN)" +
    "VALUES(SS,'" + fileName + "',EMPTY_BLOB())");
    oracle.jdbc.driver.OracleResultSet blobResultSet =
    (oracle.jdbc.driver.OracleResultSet)myStatement.executeQuery(
                   "select BLOB_COLUMN " +
                   "from LI.TEST "+
                   "where FILE_NAME = '" + fileName + "' " +
                   "FOR UPDATE" );
    blobResultSet.next();
    oracle.sql.BLOB myBlob;
    myBlob = ((oracle.jdbc.driver.OracleResultSet)blobResultSet).getBLOB("BLOB_COLUMN");
         int chunkSize = myBlob.getChunkSize();
         byte[] byteBuffer = new byte[chunkSize];
         File myFile = new File(fileName);
         FileInputStream myFileInputStream = new FileInputStream(myFile);
         long position = 1;
         int bytesRead;
         while ((bytesRead = myFileInputStream.read(byteBuffer)) != -1)
              myBlob.putBytes(position, byteBuffer);
              position += bytesRead;
         myFileInputStream.close();
    however now, it is still giving me wierd errors. It says that
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Clob getClob(int) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Clob getClob(java.lang.String) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Ref getRef(int) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Ref getRef(java.lang.String) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Blob getBlob(int) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Blob getBlob(java.lang.String) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Array getArray(int) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    D:\Tomcat\jakarta-tomcat-4.0.3\work\localhost\_\Mproject\blobtest5$jsp.java:0: The method oracle.jdbc2.Array getArray(java.lang.String) declared in interface oracle.jdbc.OracleResultSet cannot override the method of the same signature declared in interface java.sql.ResultSet. They must have the same return type.     
    package org.apache.jsp;
    ^
    8 errors, 1 warning
    can anybody tell me what i'm doing wrong? This is the last hurdle in my project and I would sincerly apprecaite any help. Many thanks
    Andrew

    OK, I'm confused. You declare a statement, set it to null, then try to execute a query with it? Your statement will still be null, you'll get a NullPointerException.
    And the OracleResultSet? This object will ONLY be created by using either Oracle's thin driver or OCI driver. The JDBC-ODBC bridge has no idea what an OracleResultSet is. The OracleResultSet IS a ResultSet object so there is no marked error on the cast, but the fit just isn't there. Had this compiled you could expect a ClassCastException at runtime.
    If you have to use ODBC, you will not be able to use Oracle-specific database objects. If you have an Oracle database available, then the ODBC driver is going to give you poor performance anyway, use Oracle's thin driver and you'll have access to the objects you're attempting to manipulate.
    And, as always, have fun!

  • Oracle BLOB insert problem

    I'm getting a ClassCastException when I try to the blob I get from my CallableStatment. I've seen alot of post about similar issues with oracle 9 and inserting blobs but I havn't found a solution..
    Here is the few lines that Im doing..
    When I check to see what type of instance this blob is this is what I get in my debugger oracle.sql.BLOB@71d768
    so When I ((BLOB)blob).getBinaryOutputStream() I get the ClassCastException..
    I've tried to get the innermost delegate and a number of other things.. When I try to cast anything to the Oracle type I get the ClassCastException. When i do an instanceof on the blob it isn't an oracle Blob.. So why does the debugger and getClass().getName() tell me it is.. And is the any work around for this..
    Thanks
    Dan
    cstmt.registerOutParameter(6, OracleTypes.BLOB);
                 cstmt.execute();
                 Blob blob = cstmt.getBlob(6);
                           if(blob != null) {
                         writer = new ObjectOutputStream( ((BLOB)blob).getBinaryOutputStream());
                        if (writer != null) {
                        writer.writeObject(bean);
                          writer.flush();
                          writer.close();
                     con.commit();

    Yes, I modified some code that a collegue used in a standalone application.. His solution was using a CLOB.. I just modified my solution to use a CLOB instead of a BLOB(saving a bean as xml instead of the bean object)..
    So i litterally copied his code line for line.. And Im getting the same error. My app is running in tomcat whereas my collegue is using it in a standalon application. I just went thru all lib directories to make sure I only have one copy of the oracle ojdbc14.jar which is in the conf/lib directory of the tomcat server..
    I even moved my table from our oracle9 db to our oracle 10 db and still no luck..
    String beanToXml = xstream.toXML(bean);          
    cstmt.execute();
    oracle.sql.CLOB clob = ((OracleCallableStatement) cstmt).getCLOB(6)
                 if (clob != null) {
                     writer = ((CLOB) clob).getCharacterOutputStream();
                     if (writer != null) {
                       writer.write(beanToXml.toCharArray());
                       writer.flush();
                       writer.close();
                 }

  • Oracle error ORA-01461when trying to insert into an ORACLE BLOB field

    I am getting Oracle error ‘ORA-01461: can bind a LONG value only  for insert into a LONG column' when trying to insert into an ORACLE BLOB field. The error occurs when trying to insert a large BLOB (JPG), but does not occur when inserting a small (<1K) picture BLOB.(JPG). Any ideas?
    BTW, when using a SQL Server datasource using the same code.... everything works with no problems.
    ORACLE version is 11.2.0.1
    The ORACLE datasource is JDBC using Oracle's JDBC driver ojdbc6.jar v11.2.0.1 (I also have tried ojdbc5.jar v11.2.0.1; ojdbc5.jar v11.2.0.4; and ojdbc6.jar v11.2.0.4 with the same error result.)
    Here is my code:
    <cfset file_mime = Lcase(Right(postedXMLRoot.objname.XmlText, 3))>
    <cfif file_mime EQ 'jpg'><cfset file_mime = 'jpeg'></cfif>
    <cfset file_mime = 'data:image/' & file_mime & ';base64,'>
    <cfset image64 = ImageReadBase64("#file_mime##postedXMLRoot.objbase64.XmlText#")>
    <cfset ramfile = "ram://" & postedXMLRoot.objname.XmlText>
    <cfimage action="write" source="#image64#" destination="#ramfile#" overwrite="true">
    <cffile action="readbinary" file="#ramfile#" variable="image_bin">
    <cffile action="delete" file="#ramfile#">
    <cfquery name="InsertImage" datasource="#datasource#">
    INSERT INTO test_images
    image_blob
    SELECT
    <cfqueryparam value="#image_bin#" cfsqltype="CF_SQL_BLOB">
    FROM          dual
    </cfquery>

    Can't you use "alter index <shema.spatial_index_name> rebuild ONLINE" ? Thanks. I could switch to "rebuild ONLINE" and see if that helps. Are there any potential adverse effects going forward, e.g. significantly longer rebuild than not using the ONLINE keyword, etc? Also wondering if spatial index operations (index type = DOMAIN) obey all the typical things you'd expect with "regular" indexes, e.g. B-TREE, etc.

  • JDBC Receiver Adapter and Oracle BLOB

    Hi,
    I would like to put some raw data into an ORACLE BLOB using XI. My idea was to put the data in an xml element, but the JDBC sender adapter doesn't seem to be able to cope with writing. Has anybody gathered experiences regarding this topic?
    Kind regards,
    Heiko

    Hi,
    The error saying it is unable to connect to the Database, so it may be the drivers problem. once check the drivers and its syntaxes.
    Syntax :
    http://www.devx.com/tips/tip/28818
    For Download and configure the drivers :
    http://www.aquafold.com/docs-jdbcdrivers-oracle10g.html
    http://www.oxygenxml.com/database_drivers.html
    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/f04ce027-934d-2a10-5a8f-fa0b1ed4d88f

  • Can I use oracle blob by CMP bean in weblogic 6?

    I use weblogic 6.1(sp3) and Jbuilder 7.when I try to use oracle blob by CMP bean,the
    errors are:
    javax.ejb.FinderException: Exception raised in findByPrimaryKey
    java.io.StreamCorruptedException: InputStream does not contain a serialized object
    What should I do?Is there examples about using oracle blob?
    thanks a lot!

    Great! So what was the problem?
    Regards,
    Slava Imeshev
    "Roger Lee" <[email protected]> wrote in message
    news:[email protected]...
    >
    Finally got it working with CMP, which is my preferred choice (over BMP).
    I read the Excel Spreadsheet into a "byte []" array, and the Entity Beanmapped
    "byte []" to the Blob column in the Oracle table.
    "Slava Imeshev" <[email protected]> wrote:
    Roger,
    I'm not quite sure I undestand the problem. Could you:
    1. Post deployment descriptors in part related to this
    CMP bean?
    2. Post the piece of code that is failing?
    Please post the information above and we will help
    you to hunt the problem down.
    No, I don't have any problems accessing blobs
    from CMP.
    Regards,
    Slava Imeshev
    "Roger Lee" <[email protected]> wrote in message
    news:[email protected]...
    Yes. I have added;
    <dbms_column-type>OracleBlob</dbms-column-type>
    It fails because the locater to the blob, obtained by findBYPrimaryKeyis
    null.
    i.e. an empty_blob() is not created.
    Have you got CMP to access Blobs in WLS 6.1?
    "Slava Imeshev" <[email protected]> wrote:
    Hi Roger,
    Have you tried using OracleBlob as dbms-column-type?
    Also, could you post that part of your code that is failing?
    Regards,
    Slava Imeshev
    "Roger Lee" <[email protected]> wrote in message
    news:[email protected]...
    I can access Clobs using CMP. If you are using the Oracle OCI Driveryou
    do not
    need to add this line.
    However if you are using the Oracle Type 4 Thin drivers you need
    to
    add;
    <dbms_column-type>OracleClob</dbms-column-type>
    to the file;
    weblogic-cmp-rdbms-jar-xml
    This DOES NOT work with Blobs.
    I am unable to get WebLogic 6.1 sp4 persist a Blob to an Oracle
    8.1.x
    table and
    retrieve it using either CMP or BMP.
    Unless any one show me a complete working CMP and BMP example?
    Roger Lee
    Deepak Vohra <[email protected]> wrote:
    BLOB and CLOB DBMS Column Support for the Oracle DBMS
    http://edocs.bea.com/wls/docs61/ejb/cmp.html#1061636
    shybird wrote:
    I use weblogic 6.1(sp3) and Jbuilder 7.when I try to use oracle
    blob
    by CMP bean,the
    errors are:
    javax.ejb.FinderException: Exception raised in findByPrimaryKey
    java.io.StreamCorruptedException: InputStream does not contain
    a
    serialized
    object
    What should I do?Is there examples about using oracle blob?
    thanks a lot!

  • Oracle BLOB value to a LC variable

    Hello,
    Is it possible in LC ES2 to coerce oracle blob value to some livecycle variable ?
    When mapping sql query result (column of type BLOB) to a LC variable (of type Document), we receive:
    com.adobe.workflow.datatype.InvalidCoercionException: Cannot coerce object: oracle.sql.BLOB@27e7d6 of type: oracle.sql.BLOB to type: com.adobe.idp.Document
    We have tried mapping to string, binary, Document (, we even desperately hardcoded sql.oracle.BLOB to process XML), but none of this works.
    Is it possible to solve this other way, then following ?
    http://groups.google.com/group/livecycle/browse_thread/thread/6c4b9156b52b71a7
    Thanks.

    My idea is to fetch the BLOB column data as UTF8 (base64) encoded string and then use getDocumentFromBase64 available in ES2.
    I am not sure what syntax is to fetch from ORACLE.
    I have used MySql database and the query is:
    SELECT CONVERT(Blob_Column USING UTF8) as MyBlobDataAsBase64Str FROM myTableName;
    Now using SetValue activity to look like:   myXMLvariable = getDocumentFromBase64(strVariableHoldingBase64Data)
    This case works perfectly without any issues.
    The problems is you should find out the appropriate syntax for ORACLE.
    I was searching about CONVERT() & UNISTR() functions. But i'm unable to evaluate.
    Try by yourself..
    Nith

  • Store pdf in oracle  BLOB  hibernate

    I need to store PDF files in the oracle BLOB using hibernate. I am using the below code and getting a null pointer. Any thoughts?
    Blob blob=null;
    byte [] bFile = (byte[])objVal;
    blob.setBytes(0,bFile); //null pointer here...
    logger.info("EventsDAO- insertDetails- else:--"+((byte[])objVal)+"---blob----"+blob);
    hmForm.put(objKey,blob); Thanks in advance.

    Samples? Are you asking how to make a blob? I have my doubts about the wisdom of using Hibernate if you can't diagnose a NPE unless that was just momentary code snow-blindness, but whatever, it's your problem:
    Either call Hibernate.createBlob(InputStream,long) or just map the field as a byte[] and map it to a Blob type.
    Edited by: dcminter on 09-Jun-2008 22:22

  • Image from Oracle BLOB is not showing

    Hi all!
    Im trying to use this code:
    <?php
    //... etc
    $sql = oci_parse($c, 'select * from pf2.documents ');
    oci_execute($sql);
    echo "<table width = 200 border = 1 cellspacing=0 cellpadding=0>";
    while ($row = oci_fetch_assoc($sql)) {
    echo "<tr>";
    echo"<td style=background-color:#DDDEEE; align=center>";
    echo $row['SHORTNAME'] ;
    echo"</td>";
    echo"<td style=background-color:#DDDEEE; align=center>";
    print $row['FILENAME'] ->load();
    echo"</td>";
    echo "</tr>";
    echo "</table>";
    //... etc
    ?>
    Here im trying to select and publish an image from Oracle BLOB,
    but in Mozilla Firefox im getting just whong text:
    яШяа�JFIF��`�`��яЫ�C� $.' ",#(7),01444'9=82<.342яЫ�C 2!!22222222222222222222222222222222222222222222222222яА�МЂ"�яД����������� яД�µ���}�!1AQa"q2Ѓ‘Ў#B±БRСр$3br‚ %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyzѓ„…†‡€‰Љ’“”•–—�™љўЈ¤Ґ¦§Ё©ЄІіґµ¶·ё№єВГДЕЖЗИЙКТУФХЦЧШЩЪбвгдежзийкстуфхцчшщъяД�������� яД�µ��w�!1AQaq"2ЃB‘Ў±Б #3RрbrС $4б%с
    Please help!
    P.S.: Im using PHP 5.2.10 under Wintel platform,
    Oracle 9.2.0.4,
    create table DOCUMENTS
    DOCID NUMBER(10) not null,
    SHORTNAME VARCHAR2(30) not null,
    FULLNAME VARCHAR2(250) not null,
    FILENAME BLOB not null,
    AUTHOR VARCHAR2(30) not null,
    CREATIONDT DATE not null,
    VERSION VARCHAR2(10) not null
    Edited by: user502299 on 28.09.2009 5:33

    I am having a similiar problem. I have created the image.php file:
    <?
    $query = "select a.image_file FROM officer_image a, officer_info b where a.officer_id=b.officer_id and b.officer_lname like 'LEDEZ%' ";
    $stmt = @OCIParse ($db_conn, $query);
    @OCIExecute($stmt, OCI_DEFAULT);
    @OCIFetchInto($stmt, $arr, OCI_ASSOC+OCI_RETURN_LOBS);
    $result = $arr['BLOB'];
    @OCIFreeStatement($stmt);
    @OCILogoff($conn);
    $im = @imagecreatefromstring ($result);
    if (!$im) {
    $im = imagecreate(150, 30);
    $bgc = imagecolorallocate($im, 255, 255, 255);
    $tc = imagecolorallocate($im, 0, 0, 0);
    imagefilledrectangle($im, 0, 0, 150, 30, $bgc);
    imagestring($im, 1, 5, 5, "", $tc);
    Header("Content-type: image/jpeg");
    Header("Content-Disposition: attachment; filename=filename_".uniqid(time()).".jpg");
    imagejpeg($im,'',100);
    imagedestroy($im);
    ?>
    And then in the actual search web page:
    <?php
              $tname = $_POST['lname'];
              $lname = "{$tname}%";
              $id = "1";
              //$query = "SELECT officer_id, image_file FROM officer_image WHERE ID='.$id.'";
              $query = "select a.image_file FROM officer_image a, officer_info b where a.officer_id=b.officer_id and b.officer_lname like 'LEDEZ%' ";
              //oci_bind_by_name($sql, ":bv", $lname);
              //oci_execute($sql);
              $stid = OCIParse($conn,$query);
              Header("content-type:image/jpeg");
              OCIExecute($stid, OCI_DEFAULT);
              while($succ= OCIFetchInto($stid,$row)) {
                   foreach($row as $item) {
         $blob_message = $item->load();
                   // Output the image
              //imagejpeg($blob_message);
              echo $blob_message . " " ;
              //echo "<img src="image.php?id='.$blob_message.'" border="0">. $rows['officer_id']."\">\n";
              echo "<br /><br />";
                   // Free up memory
              //imagedestroy($im);
              //while ($row = oci_fetch_assoc($sql))
    ?>
    Can anyone help?

  • PDF binary variable won't save in Oracle blob

    I am reading in a small, legitimate PDF as a binary variable and them immediately saving that variable into a blob. But the blob doesn't store the data.
    <cffile action="readbinary" file="C:\Test_Files\test.pdf" variable="testdoc">
    now shows isbinary(testdoc) = YES
    In fact, I can output to the screen using cfcontent, and it displays fine.
    But if I try to save the testdoc variable to an Oracle blob, CF seems to think it is trying to insert an empty variable.
    <cfquery name="ins" datasource="#request.a_datasource#">
    INSERT
    INTO PROD_WCT.T_DOCS (
    PDF_BLOB
    VALUES (
    <cfqueryparam value="#testdoc#" cfsqltype="CF_SQL_BLOB">
    Now if I retrieve that row (query name=”get_pdf”) and check the value, it appears empty:
    now shows isbinary(get_pdf.pdf_blob) = NO
    Nothing is done in betweent the cffile and the insert. Any ideas?

    Just an update here to note that this problem has not yet been resolved.
    This could be in incompatibility between Oracle 10g BLOBs and Coldfusion 8.
    To review, my BLOB setting in CFADMIN is enabled. To make this as simple and possible, I created a PDF from the words "Test text," so the PDF document can't get much smaller. The PDF does save to the BLOB, because in TOAD I can save the BLOB contents to a file and view it as a PDF just fine. It's when I retrieve the record in CF8 where the trouble arises. Coldfusion 8 doesn't get anything from the BLOB. It has a zero length, and isbinary = NO. We are using Oracle 10g. And using CF8. My understanding is that an Oracle blob uses pointers to locate the blob data in an area external to the database. Apparently, Coldfusion cannot retrieve the data. The process worked for the first few records when retrieving a blob and displaying it with cfcontent, but after a few records it can no longer retrieve the subsequent blob records. It just abruptly fails at that point. But again, the PDF binary data is there in TOAD.
    Could this be a bug or incompatibility with Oracle 10g? We are a state government, and it sure would help if the Adobe people could give come help here.
    Thanks in advance for any thoughts.

  • Oracle & BLOB/LONG RAW

    Hi everybody,
    I need to store binary data (> 32K) in an oracle BLOB field, respectivly commit the data to an oracle PL/SQL stored procedure.
    First I tried to use LONG RAW, but failed to commit more than 32K of data. This seems to be a documented problem, you can store 2GBs in an LONG RAW field, but PL/SQL can only store 32K in an LONG RAW variable.
    Then I tried to switch from LONG RAW to BLOB (both the field in the table and the in variable in the stored procedure) but it seems to be very complicated to use BLOB fields with JDBC.
    I've found example for a plain INSERT. First execute an INSERT with an empty BLOB, then make an SELECT FOR UPDATE on the row, obtain the reference to the BLOB-Object, alter the BLOB-Object and create an UPDATE-Statement with it.
    I've not tried this yet, but according to various web sites it should work.
    The problem is, that it does not solves the problem how to commit a BLOB value to a PL/SQL stored procedure.
    Does anyone knows a solution?
    Thx and regards,
    Robert

    Hi,
    thx for your answer.
    That's the solution I described (INSERT, SELECT, UPDATE) and only works with Statements.
    But I think I've already found a mistake of mine, I have to try this today.
    I already succeeded in creating a BLOB-Object without obtaining it from a resultset, the constructor is not documented but it exists, it looks like BLOB( OracleConnection, byte[] ).
    I think I can commit the BLOB to the stored procedure but it won't be a valid BLOB locator.
    What I've not tried yet and what I think migth be the solution is creating the valid BLOB locator inside the stored procedure using the PL/SQL BLOB methods.
    Sounds simple but for some reasons I have not thougth about it yet. :-)
    I'll report the result here if somebody else is interested in the issue. :o)
    Thx and regards,
    Robert

  • Oracle reports problem in distribution with xml file

    Hi ,
    I am having problem while I am trying to distribute the file with specifing the destination details in the xml. If I am giving the destination details in url then it is working.
    Ex.
    This is Working
    http://bryxh91:8889/reports/rwservlet?report=devlopersuit/reports/test.jsp&userid=anju/[email protected]&desformat=pdf&destype=file&desname=devlopersuit/reports/output_file.pdf
    Not working :
    http://bryxh91:8889/reports/rwservlet?report=devlopersuit/reports/test.jsp&userid=anju/[email protected]&DISTRIBUTE=YES&destination=devlopersuit/reports/dis_test.xml
    xml file
    <destinations>
    <file id="test" name="output_file.pdf" format="pdf">
    <include scr="mainSection"/>
    </file>
    </destinations>
    Error : REP-34304: Distribution failed to complete; review the distribution lists
    Its been week I tried many things , but not working.
    Right now I am trying to distribute to single file but my goal is to burst and distribute on basis of account number.
    This is the first stage of the project.
    Thanks a lot for the help
    Anju

    Hello
    see answer in Oracle reports problem in distribution with xml file
    Regards

  • Sending image from MS SQL SERVER to Oracle BLOB

    Hey all, we're trying update Oracle via a SQL Server linked server and we're having an issue with a blob column. The update from SQL is:
    UPDATE Banner..GENERAL.PS_EBI_IF_TBL
    set photo = a.blob_file, photo_change_date=a.blob_date
    from PWNT.dbo.BLOBS a, PWNT.dbo.BADGE_V b
    where a.ID = b.ID
    and base_name = b.BADGE_BASE_NAME
    and b.BADGE_blob_date > getdate()-.021
    GO
    The error we get is:
    OLE DB provider "OraOLEDB.Oracle" for linked server "Banner" returned message "ORA-01747: invalid user.table.column, table.column, or column specification".
    The syntax is correct, we can run it if the column being updated (photo) is not a blob, so we believe there is something else we have to do because of the blob. Has anybody done anything like this and know how it works? Thanks!
    Tom

    Given that there are no version numbers is your post I can imagine many possibilities for misconfiguration. Especially as an Oracle BLOB bears no direct size relationship to anything MS SQL could possibly support.

  • I cannot display image (read from oracle BLOB field) on browser?

    I cannot display image (read from oracle BLOB field) on browser?
    Following is my code, someone can give me an advise?
    content.htm:
    <html>
    <h1>this is a test .</h1>
    <hr>
    <img  src="showcontent.jsp">
    </html>showcontent.jsp:
    <%@ page import="com.stsc.util.*" %>
    <%@ include file="/html/base.jsp" %>
    <% 
         STDataSet data = new STDataSet();
    //get blob field from database     
         String sql = "SELECT NR FROM ZWTAB WHERE BZH='liqf004' AND ZJH='001'";
         //get the result from database
         ResultSet rs = data.getResult(sql,dbBase);
         if (rs!=null && rs.next()) {
              Blob myBlob = rs.getBlob("NR");
              response.setContentType("image/jpeg");//
              byte[] ba = myBlob.getBytes(1, (int)myBlob.length());
              response.getOutputStream().write(ba);
              response.getOutputStream().flush();
         // close your result set, statement
         data.close();     
    %>

    Don't use jsp for that, use servlet. because the jsp engine will send a blank lines to outPutStream corresponding to <%@ ...> tags and other contents included in your /html/base.jsp file before sending the image. The result will not be treated as a valid image by the browser.
    To test this, type directly showcontent.jsp on your browser, and view it source.
    regards

  • Oracle blobs performance

    I am using Oracle Blobs to write 100 KB XML file to the database. I find the time required for writing this file to the database is around 300 ms .
    Can anyone suggest performance improvements

    Which jdbc driver are you using? Have you looked at the docs for the driver that you are using for performance hints?
    Is this a standalone program or is it a J2EE application? If a J2EE application, try the same thing from a standalone app to benchmark against

Maybe you are looking for

  • Flash animation preview is all white

    I'm using Flash CC on a windows computer. My document is an HTML5 canvas. I have my animation all finished, with the exception of the Actions for the button. I have tested the animation before adding any Actions and it shows up in the browser fine (I

  • Transfer settings "do not shuffle" and "remember position"

    All my audiobooks are marked with the 'do not shuffle' setting in iTunes. How do I get this to transfer to my nano (which thinks they are music) so I can play just music with 'shuffle all songs'? I haven't tested this yet, but the "remember position"

  • Suggestions for improvements to UPK

    For future releases: 1. Better documentation. As far as I'm aware the only documentation is that which is packaged with the product. The information I've looked at has no screenshots. Now I find it quite surprising that a company the size of Oracle c

  • Different behaviour with non-versioned and versioned jars

    Everything works fine if I do not use the 'version' attribute into my jnlp file. Now, I set this version attribute : version="1.2" for example and I rename my jar file into blabla__V1.2.jar (before it was blabla.jar). When I try to execute my applica

  • Snow Leopard 10.6.8 upgrade to Mavericks

    I have an iMac circa Nov 2011.  I had a defective hard drive and I needed the replacement.  However, my question is that I desperately need to upgrade to Mavericks.  Is there anyway that I can down load Mavericks to a USB stick or a CD, DVD or whatev