Map oracle 9 BLOB type

I am trying to map a BLOB database object to a java object using typeconversion with TopLink version 9.0.4.1 (build 040128).
How do I map a BLOB database type? I tried to map it to oracle.sql.BLOB object in my class, (private BLOB m_blobField) but I get an error message:
Local Exception Stack:
Exception [TOPLINK-3001] (OracleAS TopLink - 10g (9.0.4.1) (Build 040128)): oracle.toplink.exceptions.ConversionException
Exception Description: The object [[B@1bdc9d8], of class [class [B], could not be converted to [class oracle.sql.BLOB].
     at oracle.toplink.exceptions.ConversionException.couldNotBeConverted(ConversionException.java:35)
     at oracle.toplink.internal.helper.ConversionManager.convertObject(ConversionManager.java:154)
     at oracle.toplink.internal.databaseaccess.DatabasePlatform.convertObject(DatabasePlatform.java:562)
     at oracle.toplink.mappings.DirectToFieldMapping.getAttributeValue(DirectToFieldMapping.java:224)
     at oracle.toplink.mappings.TypeConversionMapping.getAttributeValue(TypeConversionMapping.java:41)
     at oracle.toplink.mappings.DirectToFieldMapping.valueFromRow(DirectToFieldMapping.java:458)
     at oracle.toplink.mappings.DatabaseMapping.readFromRowIntoObject(DatabaseMapping.java:860)
     at oracle.toplink.internal.descriptors.ObjectBuilder.buildAttributesIntoObject(ObjectBuilder.java:164)
     at oracle.toplink.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:322)
     at oracle.toplink.internal.descriptors.ObjectBuilder.buildObjectsInto(ObjectBuilder.java:380)
     at oracle.toplink.internal.queryframework.DatabaseQueryMechanism.buildObjectsFromRows(DatabaseQueryMechanism.java:146)
     at oracle.toplink.queryframework.ReadAllQuery.execute(ReadAllQuery.java:425)
     at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:493)
     at oracle.toplink.queryframework.ReadQuery.execute(ReadQuery.java:111)
     at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:1958)
     at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1086)
     at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1038)
     at oracle.toplink.publicinterface.Session.readAllObjects(Session.java:2372)
     at com.starhometest.Tests.RunTest.testBlob(RunTest.java:158)
     at com.starhometest.Tests.RunTest.main(RunTest.java:59)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:324)
     at com.intellij.rt.execution.application.AppMain.main(AppMain.java:78)
Exception in thread "main"
Trying to map it to the Blob interface also doesn't work.
Can anyone help?

BLOB should be mapped to a byte array using TypeConversionMapping with a target type java.sql.Blob. Also Oracle8Platform or Oracle9Platform should be used.
For more details please see http://www.oracle.com/technology/products/ias/toplink/technical/tips/LOB/index.html

Similar Messages

  • How to map Oracle ORDImage type, what is the JDBC-type ?

    Hello,
    I have a field in my Oracle database that has the type ORDSYS.ORDIMAGE. How can I map this in the standardjbosscmp-jdbc.xml file of JBOSS (in the part of the oracle 9i type-mappings)?
    The java type is "oracle.ord.im.OrdImage", but what is the jdbc-type ? Do I have to include extra oracle files in some directories of Jboss ?
    <mapping>
    <java-type>oracle.ord.im.OrdImage</java-type>
    <jdbc-type>?</jdbc-type>
    <sql-type>?</sql-type>
    </mapping>
    Thanks!!!
    Greetz J

    I've never used JBOSS, but, could the jsbc type indicate the jdbc driver to use?
    The sql type is ORDSYS.ORDIMAGE, but I am not sure what JBOSS is looking for...

  • ADF Business Component Type MAP Oracls vs Java

    what the advantages and disadvantages from each one map type
    thank in advance

    Take a look at this link in developer's guide:
    http://docs.oracle.com/cd/E16162_01/web.1112/e16182/bcintro.htm#sm0062
    The Java Extended for Oracle type map and the Oracle Domains type map handle numeric data differently. When you create a new application the default type map Java Extended for Oracle maps numeric data to the java.math.BigDecimal >class, which inherits from java.math.Number. The java.math.BigDecimal default matches the way the Fusion web application view layer, consisting of ADF Faces components, preserves alignment of numeric data (such as numeric values >displayed by ADF Faces input fields in a web page). Whereas the Oracle Domains type map, which maps numeric data to the oracle.jbo.domain.Number class, may not display the data with the alignment expected by certain ADF Faces >components. Aside from this alignment issue, the Oracle Domains type map remains a valid choice and applications without ADF Faces components will function without issue.Thanks,
    Navaneeth

  • How to transfer BLOB type of data from SQL Server to Oracle

    Hi,
    Actually, I create a table with BLOB type data in SQL server. In fact, there is not exact BLOB type in SQL server, it will be separated to image and ntext types. But there is exact BLOB type in Oracle.
    I don't know how to transfer this "BLOB" type into Oracle with DTS or any other methods.
    Many Thanks for your any suggestions,
    Cathy

    JAVA_GREEN wrote:
    No i haven't mixed up.But the file from where i have to retrieve the data is in csv format.Even though i created another csv driver.and tried but i cud not find a solution to load/transfer a set of records from one file(in Excel/csv format) to another file(in mdb format).plz help me.Is there any other methods for this data transfer.A csv file is NOT an excel file.
    The fact that Excel can import a csv file doesn't make it an excel file.
    If you have a csv file then you must use a csv driver or just use other code (not jdbc) to access it. There is, normally, a ODBC (nothing to do with java) text driver that can do that.

  • Blob type parameter in procedure for display issue. Oracle portal bug?

    Hi Guy,
    I am not sure this is a bug or not for oracle portal.
    I have a table that have a column type as blob.
    by oracle portal10g, this column should be display as Item Type Upload (Binary) at Item Level Options.
    We can create a form to display this file and modify it.
    However, It can not to use a procedure with a blob column to create the same form as above. we can not find Item Type as Upload (Binary) in form. if we choose text area.
    We will get a error "ORA-01403: no data found (WWV-11230)"
    We find this issue during convert clob column to blob type in procedure for a form using.
    This is a simple procedure.
    See below source codes:
    Thanks for any help.
    create or replace Procedure test_file
    (     p_DOCUMENT_ID      IN OUT file.DOCUMENT_ID%type,
         p_USER_ID           out file.USER_ID%type,
         p_DOCUMENT_NAME out file.DOCUMENT_NAME%type,
         p_DOCUMENT      out      blob,
         p_CREATED_BY           out file.CREATED_BY%type,
         p_CREATED_TIMESTAMP      out file.CREATED_TIMESTAM%type,
         p_UPDATED_BY           out file.UPDATED_BY%type,
         p_UPDATED_TIMESTAMP      out file.UPDATED_TIMESTAMP%type,
         p_DOCUMENT_DESC      out file.DOCUMENT_DESC%type) as
    L_DOCUMENT BLOB;
    begin
    begin
    SELECT USER_ID , DOCUMENT_NAME,DOCUMENT, DOCUMENT_MIME, CREATED_BY, CREATED_TIMESTAMP,
         UPDATED_BY , UPDATED_TIMESTAMP, DOCUMENT_DESC
    INTO p_USER_ID , p_DOCUMENT_NAME,L_DOCUMENT, p_DOCUMENT_MIME, p_CREATED_BY, p_CREATED_TIMESTAMP,
         p_UPDATED_BY , p_UPDATED_TIMESTAMP, p_DOCUMENT_DESC
    FROM file
    WHERE DOCUMENT_ID = p_DOCUMENT_ID;
    exception
    when NO_DATA_FOUND then
    null;
    end;
         p_DOCUMENT :=L_DOCUMENT;
    exception
    when others then
    null;
    end;

    Hi,
    I have created a vo with transient attributes and attached the vo to the am.
    But when I am trying to insert the row from my collection, it is giving me '
    oracle.jbo.NoDefException: JBO-25058: Definition of resField of type Attribute not found in ResVO
    But I have the transient attribute resField in my ResVO and I attached the same to AM also
    I am trying to get the VO in my controller like the below:
    OAViewObject resvo = (OAViewObject) am.findViewObject("ResVO");
    if(vo==null)
    resvo = am.createViewObject("ResVO","xxcust.oracle.apps.xxcust.server.ResVO");
    if(vo!= null)
    resvo.executeQuery();
    //Creating and inserting values into the vo
    Row row = resvo.createRow();
    resvo.insertRow(row);
    row.setAttribute("resField", "AB");
    row.setAttribute("Value", "CD");
    row.setAttribute("Desc", "Test");
    When I am running my page, I am getting the
    oracle.jbo.NoDefException: JBO-25058: Definition of resField of type Attribute not found in ResVO
    I checked the spelling and the attribute name is correct.
    Is it the problem with VO having all the transient attributes or am I missing something?
    I appreciate your help...

  • Mapping between oracle data types and ms sql server data types

    hello
    i need mapping between oracle data types and ms sql server data types
    where can i find them ?

    read this
    http://download.oracle.com/docs/cd/E10405_01/doc/appdev.120/e10379/ss_oracle_compared.htm

  • Mapping Oracle types

    How can I collect in oracle the type of data "TABLE" returned by a procedure stored to utilize its data. It is to do the mapping to java.
    String mp = "{call MP_Procedure(?,?)}";          
    // Access to database
         CallableStatement cs = (CallableStatement)con.prepareCall(mp);               
         cs.setInt(1,326);          
         cs.registerOutParameter(2, OracleTypes.ARRAY); ?????????????
         cs.execute();               
    .....

    Well, in oracle database exists the type Table that is a matrix of objetcs. My database administrator use them to make stored procedure so i need to colect his contents, you know I can't explain why my database admnistrator use it, but she uses them.
    So can you help me?
    Sorry about my english :D

  • I want to store and retrieve images from a oracle datrabase's BLOB type

    Hi all
    I am using WebLogic and Oracle 10g.I have to store images and retrieve them from a BLOB type.
    Please help .

    Please have a look to the Database Application Developer's Guide - Large Objects
    http://download-uk.oracle.com/docs/cd/B19306_01/appdev.102/b14249/toc.htm

  • How to migrate sql server image type to oracle BLOB

    In SQL Server table I have Image data type field. How to migrate image type field to oracle BOLB type field. I am using SQL server DTS to transfer the data.
    If we map, will it care ?
    Thanks,
    Venkataraman L

    Hi you might want to post your question in General Forum.
    General Database Discussions
    There's very few users visit this forum.

  • 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

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

  • Error while migrating BLOB type data

    Hi ,
    I am migrating the data from oracle to oracle and both soruce and target tables have BLOB type field.
    I am getting error when I am executing the interface with these blob fields. But My interface is successfull if I am not maaping this blob files.
    Below is the error message.
    ODI-1217: Session BLOB (162501) fails with return code 942.
    ODI-1226: Step BLOB fails after 1 attempt(s).
    ODI-1240: Flow BLOB fails while performing a Loading operation. This flow loads target table IMAGES.
    ODI-1228: Task SrcSet0 (Loading) fails on the target ORACLE connection YAGLD.
    Caused By: java.sql.BatchUpdateException: ORA-00942: table or view does not exist
    Thanks,
    Patel.

    Duplicate of
    Error while migrating BLOB type data

  • Download link to file saved in BLOB type in database

    Hi all,
    I have made a page where i am letting users upload a file in any format, and i'm saving it to database in BLOB datatype field of a table.
    The filetype is also saved in a different column of the table.
    Now I want to retrieve the contents back in that particular format by converting the data in BLOB type to filetype.
    And a link should be provided to download the file.
    A little help can be taken from this link which uses EJB session to do the same thing.
    [http://jdev1013.blogspot.com.au/2009/08/file-upload-and-download-in-toplink-adf.html]
    I want to do the same in ADF 11g JDeveloper using Oracle XE database connection.
    Below is the code i used to upload file data - now i want to download file data -
    public String uploadFile() {
    String amDef = "cabinet.model.AppModule";
    String config = "AppModuleLocal";
    ApplicationModule am = Configuration.createRootApplicationModule(amDef, config);
    ViewObject vo1 = am.findViewObject("XfileView1");
    Row row = vo1.createRow();
    if (uploadedFile.getFilename() != null){       
    byte[] array=new byte[(int)uploadedFile.getLength()];
    row.setAttribute("FileName", uploadedFile.getFilename());
    row.setAttribute("FileContent",createBlobDomain(uploadedFile));
    row.setAttribute("FileType", uploadedFile.getContentType());
    row.setAttribute("FileSize", uploadedFile.getLength());
    vo1.insertRow(row);
    am.getTransaction().commit();
    DCBindingContainer bindings =
    (DCBindingContainer)BindingContext.getCurrent().getCurrentBindingsEntry();
    DCIteratorBinding dcItteratorBindings =
    bindings.findIteratorBinding("XfileView1Iterator");
    dcItteratorBindings.refresh(1);
    Configuration.releaseRootApplicationModule(am, true);
    return "added";
    private BlobDomain createBlobDomain(UploadedFile file)
    // init the internal variables
    InputStream in = null;
    BlobDomain blobDomain = null;
    OutputStream out = null;
    try
    // Get the input stream representing the data from the client
    in = file.getInputStream();
    // create the BlobDomain datatype to store the data in the db
    blobDomain = new BlobDomain();
    // get the outputStream for hte BlobDomain
    out = blobDomain.getBinaryOutputStream();
    IOUtils.copy(in, out);
    catch (IOException e)
    e.printStackTrace();
    catch (SQLException e)
    e.fillInStackTrace();
    // return the filled BlobDomain
    return blobDomain;
    Thanks
    Cheena Malhotra

    Check my 3 part blog about this. This should cover your needs. http://wp.me/pcBZk-aU
    Timo

  • How to show BLOB type Column ? In XE

    How to show BLOB type Column as image in APEX report area? (In XE)
    I did it with the following procedure
    create or replace PROCEDURE MY_IMAGE_DISPLAY (p_image_id IN NUMBER)
    AS
    l_mime VARCHAR2 (255);
    l_length NUMBER;
    l_file_name VARCHAR2 (2000);
    lob_loc BLOB;
    BEGIN
    SELECT 'JPEG', MLOGO, 'IMAGE', DBMS_LOB.getlength (MLOGO)
    INTO l_mime, lob_loc, l_file_name, l_length
    FROM CARS_TABLE
    WHERE M_ID = p_image_id;
    OWA_UTIL.mime_header (NVL (l_mime, 'application/octet'), FALSE);
    HTP.p ('Content-length: ' || l_length);
    OWA_UTIL.http_header_close;
    WPG_DOCLOAD.download_file (lob_loc);
    END my_image_display;
    GRANT EXECUTE ON my_image_display TO PUBLIC;
    and executed the following command
    CREATE PUBLIC SYNONYM my_image_display FOR shema_name.my_image_display;
    but under XE , I can not see synonym? why?

    sakrami,
    Your question really belongs in the XE forum:
    Oracle Database Express Edition (XE)
    I think this posting addresses your question:
    Re: Handling of pictures changed? Item values not properly updated in Beta
    Joel

Maybe you are looking for

  • OS X 10.4 Library Files Disk Space

    Hi, I recenlty purchased a MacBook and am very very impressed. Having been a Microshoft/Wintel user for many years now it makes a change to use something so different... My only gripe is that I bought My MacBook with a 60Gb disk thinking this would b

  • CSS does't work for new Web Form wpc_mini_article

    Hello, I created a new web form following [this guide|https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2041eb17-6001-2b10-b08d-b95ce55fa9b7], which works pretty good. The problem is that I personalized the sdn_general.css file but

  • Guidence needed for SAP Carrer (IS Retail+SD)

    Hi All, I am planning to change my Career path from IT Analyst to SAP IS RETAIL Consultant. I am Currently working in retail company (UK Retailer) from last 4 years as IT Analyst involved in Mapping business requirements and Implementing new systems

  • Web App Built in RAD/WebSphere try to Delpoy in BEA

    I have a web application that was written and deployed in RAD and WebSphere. I need to know have it work on BEA. I have gotten to the point where I can deploy the application to the BEA Server (I get an error) and can pull the application update and

  • Shrinking ram previews, even with All Purged!

    Hi there, I had the same problem with AE ram previews on my G4 Powerbook that I am now having on the MacBook Pro which replaced it. What happens is the ram previews get shorter and shorter. I have two gigs of memory, not a ton, but enough for at leas