BLOB, MySQL and Creator table

I am trying to get a table to display a set of blob images from a MYSQL database. When I dataProvider is dropped onto the table, the default Component type is Static text and for some reason does not recognise that thse field are of type blob/jpg.
If i try to mannually change the Component type to image I get the following error
Cannot display the table1 compent in the Visual Design Editor
java.lang.ClassCastException: [B
     at com.sun.web.ui.component.ImageComponentBase.getUrl(ImageComponentBase.java:496)
     at com.sun.web.ui.renderer.ImageRenderer.renderAttributes(ImageRenderer.java:92)
     at com.sun.web.ui.renderer.AbstractRenderer.encodeBegin(AbstractRenderer.java:148)
     at javax.faces.component.UIComponentBase.encodeBegin(UIComponentBase.java:683)
     at com.sun.web.ui.util.RenderingUtilities.renderComponent(RenderingUtilities.java:77)
     at com.sun.web.ui.renderer.TableColumnRenderer.encodeChildren(TableColumnRenderer.java:154)
     at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
     at com.sun.web.ui.util.RenderingUtilities.renderComponent(RenderingUtilities.java:79)
     at com.sun.web.ui.renderer.TableRowGroupRenderer.encodeChildren(TableRowGroupRenderer.java:164)
     at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
     at com.sun.web.ui.util.RenderingUtilities.renderComponent(RenderingUtilities.java:79)
     at com.sun.web.ui.renderer.TableRenderer.encodeChildren(TableRenderer.java:142)
     at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:701)
Have I come accros a bug here or am I doing something wrong?
In the properties of the colum in the Server palette the SQL type is shown as LONGVARBINARY. I have used the Blog images in another Application successfully so I know there is no issue with the data itself. I someone could shed some light on the situation I would be delighted
Kind regards
BOC

Hi,
Please take a look at the below thread
http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=46410
Hope this helps
MJ

Similar Messages

  • CF 6.1, cfquery, MySQL, and temp tables

    I have a need to use a temp table for a page, and I'm finding
    that temporary tables are not temporary when creating them via CF.
    The temporary table is not being dropped when the page is
    done processing, and what's worse is that when running the page
    from multiple browsers, the temporary table is being SHARED across
    requests, defeating the whole purpose of a "private" temporary
    table for each request of the table.
    I have a feeling this has something to do with the way CF
    maintains its connection pool, but I'd like to know the real story
    from anyone who knows. And even better, I'd like to know how to
    prevent this from happening :)
    The fact that the table isn't dropping automatically doesn't
    bother me; I can always drop it manually. However the fact that I
    can request the page on one computer, then go to another computer
    and request it and I'm using the same temp table. I consider that a
    deal breaker.
    Any ideas?

    > the table isn't dropping automatically doesn't bother me
    I think the reason why the temp tables are not being dropped
    automatically
    is because CF caches Connection(s) to the database.
    Perhaps it's better to drop temp tables than to have CF
    re-create connections
    to the database for each client request?
    I think there is a setting in CF Admin where you can specify
    a DSN to NOT
    to maintain connections across client requests? This might do
    what you
    are looking for but it may not be what you want.
    Good luck!

  • Search a text in a multiple tables and one table has BLOB column

    Hi,
    I couldn't find a solution/examples for below scenario in oracle text documentation or related forums.
    I need to search a text in a multiple tables,in that one table has blob column which is used to store the documnents(pdf,doc,jpg..etc) and other tables have varchar2 columns,These tables have realation each other.
    Please provide a sample examples for above scenario.
    Thanks in advance..

    Have a look at my blog entry here:
    https://blogs.oracle.com/searchtech/entry/indexing_data_from_multiple_tables
    That describes two methods of achieving what you are looking for.

  • How to handle blob data with java and mysql and hibernate

    Dear all,
    I am using java 1.6 and mysql 5.5 and hibernate 3.0 . Some time i use blob data type . Earlier my project's data base was oracle 10g but now i am converting it to Mysql and now i am facing problem to save and fetch blob data to mysql database . Can anybody give me the source code for blob handling with java+Mysql+Hibernate
    now my code is :--
    ==================================================
    *.hbm.xml :--
    <property name="image" column="IMAGE" type="com.shrisure.server.usertype.BinaryBlobType" insert="true" update="true" lazy="false"/>
    ===================================================
    *.java :--
    package com.shrisure.server.usertype;
    import java.io.OutputStream;
    import java.io.Serializable;
    import java.sql.Blob;
    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Types;
    import javax.naming.InitialContext;
    import javax.sql.DataSource;
    import oracle.sql.BLOB;
    import org.hibernate.HibernateException;
    import org.hibernate.usertype.UserType;
    import org.jboss.resource.adapter.jdbc.WrappedConnection;
    import com.google.gwt.user.client.rpc.IsSerializable;
    public class BinaryBlobType implements UserType, java.io.Serializable, IsSerializable {
    private static final long serialVersionUID = 1111222233331231L;
    public int[] sqlTypes() {
    return new int[] { Types.BLOB };
    public Class returnedClass() {
    return byte[].class;
    public boolean equals(Object x, Object y) {
    return (x == y) || (x != null && y != null && java.util.Arrays.equals((byte[]) x, (byte[]) y));
    public void nullSafeSet(PreparedStatement st, Object value, int index) throws HibernateException, SQLException {
    BLOB tempBlob = null;
    WrappedConnection wc = null;
    try {
    if (value != null) {
    Connection oracleConnection = st.getConnection();
    if (oracleConnection instanceof oracle.jdbc.driver.OracleConnection) {
    tempBlob = BLOB.createTemporary(oracleConnection, true, BLOB.DURATION_SESSION);
    if (oracleConnection instanceof org.jboss.resource.adapter.jdbc.WrappedConnection) {
    InitialContext ctx = new InitialContext();
    DataSource dataSource = (DataSource) ctx.lookup("java:/DefaultDS");
    Connection dsConn = dataSource.getConnection();
    wc = (WrappedConnection) dsConn;
    // with getUnderlying connection method , cast it to Oracle
    // Connection
    oracleConnection = wc.getUnderlyingConnection();
    tempBlob = BLOB.createTemporary(oracleConnection, true, BLOB.DURATION_SESSION);
    tempBlob.open(BLOB.MODE_READWRITE);
    OutputStream tempBlobWriter = tempBlob.getBinaryOutputStream();// setBinaryStream(1);
    tempBlobWriter.write((byte[]) value);
    tempBlobWriter.flush();
    tempBlobWriter.close();
    tempBlob.close();
    st.setBlob(index, tempBlob);
    } else {
    st.setBlob(index, BLOB.empty_lob());
    } catch (Exception exp) {
    if (tempBlob != null) {
    tempBlob.freeTemporary();
    exp.printStackTrace();
    st.setBlob(index, BLOB.empty_lob());
    // throw new RuntimeException();
    } finally {
    if (wc != null) {
    wc.close();
    public Object nullSafeGet(ResultSet rs, String[] names, Object owner) throws HibernateException, SQLException {
    final Blob blob = rs.getBlob(names[0]);
    return blob != null ? blob.getBytes(1, (int) blob.length()) : null;
    public Object deepCopy(Object value) {
    if (value == null)
    return null;
    byte[] bytes = (byte[]) value;
    byte[] result = new byte[bytes.length];
    System.arraycopy(bytes, 0, result, 0, bytes.length);
    return result;
    public boolean isMutable() {
    return true;
    public Object assemble(Serializable arg0, Object arg1) throws HibernateException {
    return assemble(arg0, arg1);
    public Serializable disassemble(Object arg0) throws HibernateException {
    return disassemble(arg0);
    public int hashCode(Object arg0) throws HibernateException {
    return hashCode();
    public Object replace(Object arg0, Object arg1, Object arg2) throws HibernateException {
    return replace(arg0, arg1, arg2);
    =================================================================
    can anyone give me the source code for this BinaryBlobType.java according to mysql blob handling ..

    Moderator action: crosspost deleted.

  • Reimport and Refresh Tables (MySQL DB adapter)

    Hello.
    I created DB adapter to MySQL DB in JDeveloper 11.1.1.5.
    Everytime I open Adapter Configuration Wizard on this DB Adapter I get warning: Reimport and Refresh Tables.
    "Some changes have been detected in the relational schema since these tables were imported. Please go back to the select tables page and reimport them. The changes are major enough that they can't be easily reconciled. The changes are: Table removed: ..." even there are not any changes in schema and tables still exists.
    Is it a bug or feature?
    I never saw this behaviour with Oracle DB. Is it a problem with MySQL JDBC driver?
    Thanks

    Looks like a bug to me. You should file an SR...
    Timo

  • Report with a Download link for a Pdf stored in Blob in database FND tables

    We attach a pdf file in the Receivables invoices in Oracle EBS. We use APEX to report from EBS tables. We have a requirement to have a APEX report to display the pdf attached to the invoices with a capability to download the pdf. These pdf are stored in a blob column in fnd_lobs table.
    Any pointers on how to approach is highly appreciated.
    Thanks
    Jo

    check this How to Upload and Download Files in an Application
    let me know if you have any doubts

  • Performance with MySQL and Database connectivity toolbox

    Hi!
    I'm having quite some problems with the performance of MySQL and Database connectivity toolbox. However, I'm very happy with the ease of using database connectivity toolbox. The background is:
    I have 61 variables (ints and floats) which I would like to save in the MySQL-database. This is no problem, however, the loop time increases from 8ms to 50ms when using the database. I have concluded that it has to do with the DB Tools Insert Data.vi and I think that I have some kind of performance issue with this VI. The CPU never reach more the 15% of its maximum performance. I use a default setup and connect through ODBC.
    My questions are:
    1. I would like to save 61 variables each 8-10ms, is this impossible using this solution?
    2. Is there any way of increasing the performance of the DB Tools Insert Data.vi or use any other VI?
    3. Is there any way of adjusting the MySQL setup to achieve better performance?
    Thank you very much for your time.
    Regards,
    Mattias

    First of all, thank you very much for your time. All of you have been really good support to me.
    >> Is your database on a different computer?  Does your loop execute 61 times? 
    Database is on the same computer as the MySQL server.
    The loop saves 61 values at once to the database, in one SQL-statement.
    I have now added the front panel and block diagram for my test-VI. I have implemented the queue system and separate loops for producer and consumer. However, since the queue is building up faster then the consumer loop consumes values, the queue is building up quite fast and the disc starts working.
    The test database table that I add data to is created by a simple:
    create table test(aa int, bb char(15));
    ...I'm sure that this can be improved in some way.
    I always open and close the connection to the database "outside the loop". However, it still takes some 40-50 ms to save the data to the database table - so, unfortunatly no progress to far. I currently just want to save the data.
    Any more advise will be gratefully accepted.
    Regards,
    Mattias
    Message Edited by mattias@hv on 10-23-2007 07:50 AM
    Attachments:
    front panel 2.JPG ‏101 KB
    block diagram.JPG ‏135 KB

  • Show a blob( pdf ) from db-table  in the clients browser/ web.show_document

    my env:
    Database R11_2 on one windows-host-machine
    AS 10 g on another windows-host-machine
    I can show files in Forms10g from inside the AS with web.show_document,
    that works fine
    but now I want to show a ( pdf or text ) File from a BLOB in a Table inside in the Database
    to the Browser running in Forms on AS,
    I do not want to create a extra Form for this reason, but want to show it in browser - windows
    ( how ) can I use web.show_document against a URL on the Database R11 ?
    what other tool , java ?
    regards

    Easiest way is probably to use mod_plsql and wpg_docload.download_file. If you retrieve the blob content from some table, than you can show it with a generic procedure like:
    procedure show_webdoc(io_blob          in out nocopy blob
                         ,i_mimetype       in varchar2
                         ,i_filename       in varchar2)
    is
    begin
       if dbms_lob.getlength(io_blob) >0 then
          owa_util.mime_header(nvl(i_mimetype,'application/octet'),false);
          htp.p('Content-length: ' || dbms_lob.getlength(io_blob));
          htp.p('Content-Disposition:  attachment; filename="'||i_filename|| '"');
          owa_util.http_header_close;
          wpg_docload.download_file(io_blob);
       end if;
    end show_webdoc;

  • How to upload a image or flash file as blob object in a table.

    How to upload a image or flash file as blob object in a table.
    What are all the possible ways we can do it.

    Searching the forum (or google) would be my first choice, as this question pops up every now and then.
    Next without knowledge of your environment (jdev version and technology stack) it's hard to give a profound answer.
    All I can say is that it's possible.
    Timo

  • How to insert a pdf or jpeg image into a blob column of a table

    How to insert a pdf or jpeg image into a blob column of a table

    Hi,
    Try This
    Loading an image into a BLOB column and displaying it via OAS
    The steps are as follows:
    Step 1.
    Create a table to store the blobs:
    create table blobs
    ( id varchar2(255),
    blob_col blob
    Step 2.
    Create a logical directory in the database to the physical file system:
    create or replace directory MY_FILES as 'c:\images';
    Step 3.
    Create a procedure to load the blobs from the file system using the logical
    directory. The gif "aria.gif" must exist in c:\images.
    create or replace procedure insert_img as
    f_lob bfile;
    b_lob blob;
    begin
    insert into blobs values ( 'MyGif', empty_blob() )
    return blob_col into b_lob;
    f_lob := bfilename( 'MY_FILES', 'aria.gif' );
    dbms_lob.fileopen(f_lob, dbms_lob.file_readonly);
    dbms_lob.loadfromfile( b_lob, f_lob, dbms_lob.getlength(f_lob) );
    dbms_lob.fileclose(f_lob);
    commit;
    end;
    Step 4.
    Create a procedure that is called via Oracle Application Server to display the
    image.
    create or replace procedure get_img as
    vblob blob;
    buffer raw(32000);
    buffer_size integer := 32000;
    offset integer := 1;
    length number;
    begin
    owa_util.mime_header('image/gif');
    select blob_col into vblob from blobs where id = 'MyGif';
    length := dbms_lob.getlength(vblob);
    while offset < length loop
    dbms_lob.read(vblob, buffer_size, offset, buffer);
    htp.prn(utl_raw.cast_to_varchar2(buffer));
    offset := offset + buffer_size;
    end loop;
    exception
    when others then
    htp.p(sqlerrm);
    end;
    Step 5.
    Use the PL/SQL cartridge to call the get_img procedure
    OR
    Create that procedure as a function and invoke it within your PL/SQL code to
    place the images appropriately on your HTML page via the PL/SQL toolkit.
    from a html form
    1. Create an HTML form where the image field will be <input type="file">. You also
    need the file MIME type .
    2. Create a procedure receiving the form parameters. The file field will be a Varchar2
    parameter, because you receive the image path not the image itself.
    3. Insert the image file into table using "Create directory NAME as IMAGE_PATH" and
    then use "Insert into TABLE (consecutive, BLOB_OBJECT, MIME_OBJECT) values (sequence.nextval,
    EMPTY_BLOB(), 'GIF' or 'JPEG') returning BLOB_OBJECT, consecutive into variable_blob,
    variable_consecutive.
    4. Load the file into table using:
    dbms_lob.loadfromfile(variable_blob, variable_file_name, dbms_lob.getlength(variable_file_name));
    dbms_lob.fileclose(variable_file_name);
    commit.
    Regards,
    Simma........

  • How can I insert a image into a BLOB column in a table?

    I am using forms6i against a 10gR2 database and I have one table with a BLOB column and I try to insert a image into this column. I get ORA-01461 error.
    The curious case is that in another table with a BLOB column it works very fine.
    What happens with the first table? How can I avoid the error?
    Thanks in advance.

    Hi hyue,
    Thanks for visiting Apple Support Communities.
    If you would like to add an image to a project in iMovie for iOS, see this article for helpful steps:
    iMovie for iOS (iPad): Add photos to a project
    http://support.apple.com/kb/PH3171
    All the best,
    Jeremy

  • Problem w/ image item using 9i BLOB field and InterMedia ORDImage Object

    Hi,dear all,
    I have a problem with image item in Form 6i. Oracle 9i is used as backend DB, and a table contains image data is created for testing:
    create table image_test(
    id number,
    image blob
    In Form 6i, there is no problem to create a block for inserting/updating the image record into the database. However, it can not be used to retrieve image (blob field), the image item remains empty after 'execute query', while the id field can be retrieved. When the same table is created in Oracle 8.1.7, and the exact same form can be used without any problem both in inserting and retrieval. It seems that the Oracle 9i does not use the same way to store BLOB column. Has anybody ever encountered this problem? How to retrieve image (BLOB) in Form 6i from Oracle 9i?
    I tried to use interMedia ORDImage as the data type in Oracle 9i, that is,
    create table image_test(
    id number,
    image ORDSYS.ORDImage
    Same problem, the form can insert record with image, but when retrieving, nothing displayed. Anybody could help! Thanks in advance!

    hi!
    well working with oracle8i and form6i.
    same problem..but i used (instead of blob or clob as datatype..) Long raw..
    it can be saved as usual..i mean Commit..
    and can be retrieved..using Execute_Query..its working fine..
    well if anybody get any other solution..do inform..
    mail_id:
    [email protected]

  • Insert data from XML in a BLOB column to a table

    I have a situation where my source table has a blob column and an XML file is loaded into it.
    Whenever an insert into the table happens I need to read the XML and insert the values from XML to a target table .
    I have done it with oracle inbuilt parser and tokens but this will do a call to the database when already the data is available on the extract file.That would mean a lower performance .
    Can someone help me maybe with some userexit or something
    Thanks in advance

    Please check if you can see the 'DBMS_XMLSAVE' object in all_objects.

  • How to update a BLOB column in a table with a file in local machine?

    I have a file (of XML type) in my local machine. I want to update it in a BLOB column of a table in databse server. Can anyone help me in this regard. Appreciate your help.
    Regards
    Walter Nicholas

    user447427 wrote:
    I have a file (of XML type) in my local machine. I want to update it in a BLOB column of a table in databse server. Can anyone help me in this regard.That's the client's job to read data on the client PC (from keyboard/mouse/scanner/file/whatever input) and submit that to the database server for processing and/or storage.
    You cannot expect the server to hack into your PC and lift that data in the file from your disk. Not that is not technically possible. You can wire rockets onto a bicycle to make it go faster, but that's not a wise thing to do. Similarly, it is not a bright idea to ignore the very basics of client-server.
    Bottom line - you need client s/w on your PC to load the content of that file into Oracle. It can be done using SQL*Loader as already suggested. It can be done using a web browser (submitting it via HTTP to web-enabled PL/SQL code). You can use FTP or WebDav and upload into Oracle's XDB (XML database).
    Your requirements will determine what client to use. Once off load? SQL*Loader is very easy to use for loading XML files into the database.

  • How to transfer a blob column in a table to another blob column in another

    Well as the title suggest, i'm trying to take the BLOB field in say my table Photo and put it in another BLOB field in my table Members. How would i do that?
    I'm working in Oracle Forms 10G.
    I tried to do a cursor that get the picture(BLOB) and i tried to fetch the result in the other table :Members.Photo but it says my link is not good. I also tried using variables but didn't do the trick either.
    The thing is we have a system that once the picture is taken its automatically put in the Photo table (contain only one picture at a time, only one row) and then in Forms we have have a message asking to press ok when the photo has been taken and then it should insert it in the Members table....
    if more information is required please feel free to ask!
    Thanks in advance.

    INSERT INTO CLIENTS_PHOTOS (
      CLPHOTO_ID,
      CL_ID,
      DTHRS_PHOTO,
      PHOTO,
      SIGNATURE,
      CREE_LE,
      CREE_PAR,
      MODIFIE_LE,
      MODIFIE_PAR
    )  SELECT :NOUVELLE_PHOTO.CLPHOTO_ID,
              CLIENT.CL_ID,
              SYSDATE,
              PS.PHOTO,
              PS.SIGNATURE,
              SYSDATE,
              :NOUVELLE_PHOTO.L_CD_USER,
              SYSDATE,
              :NOUVELLE_PHOTO.L_CD_USER
         FROM PHOTO_SIGNATURE PS;Looks quite ok so far. Did you try to issue that insert manually in SQL*plus? Also, is it correct that there is no WHERE-condition in your select?

Maybe you are looking for