Writing to BLOB with getBinaryOutputStream

I'm trying to insert a BLOB and have problems with a variety of the methods listed in documentation.
1) The method that is in the Oracle examples, oracle.sql.BLOB.getBinaryOutputStream(), give me a warning that it is deprecated.
2) In other Oracle documentation, getBinaryOutputStream(long) is specified, but that doesn't exist in my version of oracle.sql.BLOB.
3) Yet other documentation says to use the JDBC 3.0 standard call, which is setBinaryStream(long). However, I get this error when running it: java.lang.AbstractMethodError: java.io.OutputStream oracle.sql.BLOB.setBinaryStream(long)
I don't want to use the deprecated method, but that's the only one that works. Any ideas?
Using 10g driver with an 8i database.
thanks

I’m not sure how to use PreparedStatement.setBlob(Blob). Seems like the only way to create a BLOB is to SELECT it, and then you still need to call BLOB.setXXX. I tried setBytes(..) but get the same AbstractMethodError as with setBinaryStream(..)
Here’s the stacktrace from JDev, not sure it has what you're looking for. In this scenario, I use a PreparedStatement to create a blob locator using this:
String CREATE_STATEMENT = "INSERT INTO IWR_FILE " +
"(SA_FILE, SA_IWR, FILE_NAME, FILE_BLOB) VALUES " +
"( ?, ?, ?, empty_blob())";
I then select that record and try to write the blob using:
(imported oracle.sql.BLOB)
ResultSet blobRS = blobPS.executeQuery();
BLOB blob = (BLOB) blobRS.getBlob(1);
OutputStream blobOUT = blob.setBinaryStream(1L);
Tried casting the ResultSet to an OracleResultSet, but still got the error.
com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: java.lang.AbstractMethodError: java.io.OutputStream oracle.sql.BLOB.setBinaryStream(long)      at IWRFacade_StatelessSessionBeanWrapper0.setDTOList(IWRFacade_StatelessSessionBeanWrapper0.java:621)      at iwr.ejb.beans.Tester.testFileDAO(Tester.java:117)      at iwr.ejb.beans.Tester.main(Tester.java:47)      at mypackage7.InitiatorServlet.init(InitiatorServlet.java:27)      at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2094)      at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4523)      at com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2413) 04/08/30 09:49:04 com.evermind.server.rmi.OrionRemoteException: Transaction was rolled back: java.lang.AbstractMethodError: java.io.OutputStream oracle.sql.BLOB.setBinaryStream(long); nested exception is:
     java.rmi.RemoteException: java.io.OutputStream oracle.sql.BLOB.setBinaryStream(long); nested exception is:
     java.lang.AbstractMethodError: java.io.OutputStream oracle.sql.BLOB.setBinaryStream(long)      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:640)      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)      at java.lang.Thread.run(Thread.java:534)      Nested exception is: java.rmi.RemoteException: java.io.OutputStream oracle.sql.BLOB.setBinaryStream(long); nested exception is:
     java.lang.AbstractMethodError: java.io.OutputStream oracle.sql.BLOB.setBinaryStream(long)      at com.evermind.server.ejb.EJBUtils.makeException(EJBUtils.java:941)      at IWRFacade_StatelessSessionBeanWrapper0.setDTOList(IWRFacade_StatelessSessionBeanWrapper0.java:621)      at iwr.ejb.beans.Tester.testFileDAO(Tester.java:117)      at iwr.ejb.beans.Tester.main(Tester.java:47)      at mypackage7.InitiatorServlet.init(InitiatorServlet.java:27)      at com.evermind.server.http.HttpApplication.loadServlet(HttpApplication.java:2094)      at com.evermind.server.http.HttpApplication.findServlet(HttpApplication.java:4523)      at com.evermind.server.http.HttpApplication.getRequestDispatcher(HttpApplication.java:2413)      at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:640)      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:270)      at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:112)      at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:186)      at java.lang.Thread.run(Thread.java:534) Caused by: java.lang.AbstractMethodError: java.io.OutputStream oracle.sql.BLOB.setBinaryStream(long)      at iwr.ejb.dao.FileDAO.getInsertPS(FileDAO.java:244)      at iwr.ejb.dao.FileDAO.setDTO(FileDAO.java:90)      at iwr.ejb.beans.IWRFacadeBean.setDTOList(IWRFacadeBean.java:102)      at IWRFacade_StatelessSessionBeanWrapper0.setDTOList(IWRFacade_StatelessSessionBeanWrapper0.java:564)      ... 11 more

Similar Messages

  • Problem with writing a procedure with table name as an input parameter

    Hi all,
    I am writing a procedure with table name as an input parameter:
    below is the code
    create or replace procedure prc(in_tbl in varchar2)
    as
    begin
    execute immediate ' truncate table tlb ';
    insert into tbl
    select a,b,c from in_tbl;
    end;

    user579585 wrote:
    Hi all,
    I am writing a procedure with table name as an input parameter:
    below is the code
    create or replace procedure prc(in_tbl in varchar2)
    as
    begin
    execute immediate ' truncate table tlb ';
    insert into tbl
    select a,b,c from in_tbl;
    end;You'll also need to use dynamic sql for the insert:
    execute immediate 'begin insert into tbl select a,b,c from '||in_tbl||'; end';

  • How to convert CLOB to BLOB with SQL Developer migration wizard?

    Hi,
    According to our requirement, we need to only migrate data from SQL Server 2008 to Oracle 11. I use the SQL Developer 3.0.04 migration wizard to do it.
    I do migration from SQL Server (database name: SCDS41P2) to Oracle (User name: HCDS41P2).
    My migration steps are as below: (I need to modify the target schema, so I add the steps 2) and step 3) )
    1) Do migration by SQL Developer migration wizard;
    2) Remove the Converted Database Objects node from migration project;
    3) Re-do convert by SQL Developer migration wizard (contains changing the target schema);
    When do step 1), the DBO_SCDS41P2 user is created automatically. CLOBTOBLOB_SQLDEVELOPER procedure is also created in this user.
    I continued to run step 2) and step 3) with online mode. And find the table data which contains BLOB column can be moved into the target table. But from the Logging Page, I can't see the other detailed error info, so that I can't check which tables don't move data successfully.
    Could you please tell me where the detail log file (e.g. contains every table's migration status) is if I use the online mode?
    Additional, If I use offline mode to do step 3), I found the CLOB data can't be converted into BLOB automatically. Because in the load script (that is oracle_ctl.bat), only copy the source data to the CLOB column. After copy, it don't deal with the converting from CLOB to BLOB.
    So could you please tell me how to convert CLOB to BLOB with offline mode?
    Thanks so much.

    Hi,
    For your first question about logging - after the migration there will be an entry in the right hand panel for the migration project. If you open this there are various fields that give information about the status of each part of the migration. Does this give you the information you need ?
    For the second problem about offline moving blob data have a look at the SQL*Developer documentation -
    Oracle® SQL Developer User’s Guide Release 3.0
    in the section -
    2.2.8.1.4 Populating the Destination Database Using the Data Files
    which describes the problem and how to get round it.
    Regards,
    Mike
    Edited by: mkirtley on Aug 12, 2011 10:49 AM

  • How to store a  blob with toplink

    Hi .. I am using toplink 10g (10.1.3.0) and oracle9 and I am trying to insert a blob with toplink in the database but I dont know how I need to use a resultset and a PreparedStatement if it is the case hor how use toplink???

    You should be able to read the file in and convert its data to a byte-array in your object. TopLink will handle the conversion from byte-array to BLOB in the database.
    If you are using the Oracle thin JDBC drivers, they have a 5k size limit, if your file is larger than this you will need to use the Oracle8/9Platform in your login and a TypeConversionMapping and set the fieldClassification to java.sql.Blob.

  • Sign on problems within Elements 10; plus cannot backup writing files error with file catalog.pse10db.  No indication what the problem is.  How do I get adobe help with these problems?

    Sign on problems within Elements 10; plus cannot backup, writing files error with file catalog.pse10db.  No indication what the problem is.  How do I get adobe help with these problems?

    Sign on problems within Elements 10; plus cannot backup, writing files error with file catalog.pse10db.  No indication what the problem is.  How do I get adobe help with these problems?

  • Suppress writing cache files with rwrun.exe

    Hello,
    we`re using rwrun.exe (9.0.4.2.0) with parameters to create pdf-files in a loop:
    REPORT=mytest.rdf
    USERID=scott/tiger@orcl
    BLANKPAGES=no
    DESTYPE=file
    DESNAME=mytest.pdf
    DESFORMAT=PDF
    OUTPUTIMAGEFORMAT=GIF
    CACHELOB=NO
    Each process write a cache file in the directory …\reports\cache. Reports eats the hard disk :-(
    I`ve found the EXPIRATION command in the documentation, which defines the point in time when the report output should be deleted from the cache. But this command strictly runs with rwclient.exe and reports server, but Reports server isn`t installed on our server.
    Can we suppress writing cache files with rwrun.exe?
    Steffen

    Hello,
    Why don't you add a command del in your loop ?
    Example:
    del %ORACLE_HOME%\reports\cache\*.*
    Regards

  • I cant imagine that this kind of issues we are facing with Apple the most respective smartphone company. it is the 2nd time i am writing to you with no reply. i bought my iphone 6 from dubai on March first the it stopped working on March 12th, i gave

    i cant imagine that we are facing this kind of issues with Apple, it is the 2nd time i am writing to you with no reply. i bought my iPhone 6 from Dubai on March first then it stopped working on March 12th, i gave it to you authorized re-seller here in Egypt and they replaced it in 24 days ... after another 6 days the new phone ALSO STOPPED working, i went back to them they said sorry we will replace it again.
    i really cant imagine that i paid more than US$850 2 months ago and until now i didn't use the mobile for more that 2 weeks.
    i really appreciate your help and response

    This is a user to user forum - you are not talking to Apple here, only to other users like yourself. You will need to take this up with Apple directly: http://www.apple.com/eg/support/contact/

  • Creating/constructing a java.sql.Blob and writing to Oracle with jdbc

    I'm trying to understand how to create a blob from an image file to write it to a Oracle database using jdbc.
    I know there'a a getBinaryStream method in java.sql.Blob to which I can write the files byte array, but how do I create an actual blob in the first place. All examples I've seen initialise the blob from an exiting Blob field in a database which I do not have filled yet
    thanks

    In general, you will do something like the following:
    Ensure setAutoCommit is false
    INSERT INTO foo (blob_column) values (empty_blob());
    SELECT blob_column FROM foo FOR UPDATE;
    Call getBlob() on the ResultSet
    Cast it to Oracle's specific BLOB (different object)
    Call getBinaryOutputStream() on the BLOB
    Pipe your data
    Commit (very importatnt as FOR UPDATE will lock that row)- Saish

  • Problems writing from BLOB to File with Thin-drivers

    I'm having problems when I'm trying to put a blob to a file
    using jdbc-thin drivers(8.1.5).
    It works perfectly well with the oci-drivers but not with thin.
    When I execute the same code with the thin-drivers I get:
    Error: java.io.IOException: ORA-21560: argument 2 is null,
    invalid, or out of range
    ORA-06512: at "SYS.DBMS_LOB", line 640
    ORA-06512: at line 1
    Please help me...
    /Stefan Fgersten
    lob_loc = ((OracleResultSet)rset).getBLOB(1);
    in = lob_loc.getBinaryStream();
    FileOutputStream file =
    new FileOutputStream("d:/dir/picture.jpg");
    int c;
    while ((c = in.read()) != -1)
    file.write(c);
    file.close();
    in.close();
    null

    Has anyone managed to find a solution (other than switching drivers) for this? I too am using the 8.1.5 thin driver on an 8.1.5 database and receive the same error. Please help!!
    Nkem
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by Stefan Fgersten ([email protected]):
    I'm having problems when I'm trying to put a blob to a file
    using jdbc-thin drivers(8.1.5).
    It works perfectly well with the oci-drivers but not with thin.
    When I execute the same code with the thin-drivers I get:
    Error: java.io.IOException: ORA-21560: argument 2 is null,
    invalid, or out of range
    ORA-06512: at "SYS.DBMS_LOB", line 640
    ORA-06512: at line 1
    Please help me...
    /Stefan Fgersten
    lob_loc = ((OracleResultSet)rset).getBLOB(1);
    in = lob_loc.getBinaryStream();
    FileOutputStream file =
    new FileOutputStream("d:/dir/picture.jpg");
    int c;
    while ((c = in.read()) != -1)
    file.write(c);
    file.close();
    in.close();<HR></BLOCKQUOTE>
    null

  • How to handle Oracle BLOBs with WebLogic 10.3

    We have code that has been running for a long time to handle blobs in Oracle. We have never had a problem running inside of WebLogic, including WLS 10.0 and WLS 11. Recently, we had a customer that had a problem after they upgraded to WLS 10.3. Indeed, we downloaded that specific version and see the same issue. The issue is our Oracle db specific code is now causing an IllegalAccessException after we get the ResultSet vendor obj, by calling getVendorObj() on the WebLogic managed result set, and try to cast to an OracleResultSet. We need to do this in order to call OracleResultSet.getBLOB(), which returns an oracle.sql.BLOB. The code we use to update the blob is shown below. getOracleBLOB is our own method. It basically gets the OracleResultSet by calling getVendorObj on the managed WLS ResultSet, casting to an OracleResultSet, and calling getBLOB(colname) on it. Casting to the OracleResultSet causes the exception shown below. OK, so I understand WLS not wanting us to fiddle with the underlying db ResultSet, but what's our alternative. How can we do this without relying on the underlying OracleResultSet? After 10 years, working with many different versions of WebLogic as well as JBOSS and WebSphere, this is the first time we are seeing this.
    Thanks in advance.
    oracle.sql.BLOB blob = getOracleBLOB(rset,_columns.name);
    OutputStream os = blob.getBinaryOutputStream();
    ObjectOutputStream oos = new ObjectOutputStream(os);
    oos.writeObject(_columns[i].paramObj);
    oos.close();
    java.rmi.RemoteException: EJB Exception: ; nested exception is:
         javax.ejb.EJBException: nested exception is: javax.transaction.TransactionRolledbackException: Exception in ejbCreate(): java.lang.IllegalAccessError: tried to access class oracle.jdbc.driver.OracleResultSet from class com.armanta.ejb.gen.DefaultASHelper
         at com.armanta.ejb.gen.DefaultASHelper.getOracleBLOB(DefaultASHelper.java:183)
         at com.armanta.ejb.PreparedStatementWithBlobs.getOracleBLOB(PreparedStatementWithBlobs.java:180)
         at com.armanta.ejb.PreparedStatementWithBlobs.executeUpdate(PreparedStatementWithBlobs.java:141)
         at com.armanta.ejb.SimpleJDBCAbstractionWithBlobs.insert(SimpleJDBCAbstractionWithBlobs.java:57)
         at com.armanta.ejb.ValueContainerBean.create(ValueContainerBean.java:230)
         at com.armanta.ejb.tree.BranchBean.ejbCreate(BranchBean.java:42)
         at com.armanta.ejb.tree.Branch_y1m5sk_Impl.ejbCreate(Branch_y1m5sk_Impl.java:255)
         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:597)
         at weblogic.ejb.container.manager.ExclusiveEntityManager.create(ExclusiveEntityManager.java:775)
         at weblogic.ejb.container.manager.ExclusiveEntityManager.remoteCreate(ExclusiveEntityManager.java:746)
         at weblogic.ejb.container.internal.EntityEJBHome.create(EntityEJBHome.java:272)
         at com.armanta.ejb.tree.Branch_y1m5sk_HomeImpl.create(Branch_y1m5sk_HomeImpl.java:79)
         at com.armanta.ejb.tree.TreeMasterBean.addBranchesToTree(TreeMasterBean.java:430)
         at com.armanta.ejb.tree.TreeMaster_n4wp5c_EOImpl.addBranchesToTree(TreeMaster_n4wp5c_EOImpl.java:800)
         at com.armanta.ejb.tree.TreeMaster_n4wp5c_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    ; nested exception is:
         java.lang.IllegalAccessError: tried to access class oracle.jdbc.driver.OracleResultSet from class com.armanta.ejb.gen.DefaultASHelper
         at weblogic.rjvm.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:108)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:290)
         at weblogic.rmi.cluster.ReplicaAwareRemoteRef.invoke(ReplicaAwareRemoteRef.java:247)
         at com.armanta.ejb.tree.TreeMaster_n4wp5c_EOImpl_1030_WLStub.addBranchesToTree(Unknown Source)
         at com.armanta.datamodel.EntityTreePool.addBranchesToTree(EntityTreePool.java:773)
         at com.armanta.app.permission.MemberModel.add(MemberModel.java:233)
         at com.armanta.app.permission.MemberPanel.actionPerformed(MemberPanel.java:248)
         at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1849)
         at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2169)
         at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
         at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:258)
         at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
         at java.awt.Component.processMouseEvent(Component.java:5517)
         at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
         at java.awt.Component.processEvent(Component.java:5282)
         at java.awt.Container.processEvent(Container.java:1966)
         at java.awt.Component.dispatchEventImpl(Component.java:3984)
         at java.awt.Container.dispatchEventImpl(Container.java:2024)
         at java.awt.Component.dispatchEvent(Component.java:3819)
         at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4212)
         at java.awt.LightweightDispatcher.processMouseEvent(Container.java:3892)
         at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
         at java.awt.Container.dispatchEventImpl(Container.java:2010)
         at java.awt.Window.dispatchEventImpl(Window.java:1791)
         at java.awt.Component.dispatchEvent(Component.java:3819)
         at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
         at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
         at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
         at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
         at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
    Caused by: javax.ejb.EJBException: nested exception is: javax.transaction.TransactionRolledbackException: Exception in ejbCreate(): java.lang.IllegalAccessError: tried to access class oracle.jdbc.driver.OracleResultSet from class com.armanta.ejb.gen.DefaultASHelper
         at com.armanta.ejb.gen.DefaultASHelper.getOracleBLOB(DefaultASHelper.java:183)
         at com.armanta.ejb.PreparedStatementWithBlobs.getOracleBLOB(PreparedStatementWithBlobs.java:180)
         at com.armanta.ejb.PreparedStatementWithBlobs.executeUpdate(PreparedStatementWithBlobs.java:141)
         at com.armanta.ejb.SimpleJDBCAbstractionWithBlobs.insert(SimpleJDBCAbstractionWithBlobs.java:57)
         at com.armanta.ejb.ValueContainerBean.create(ValueContainerBean.java:230)
         at com.armanta.ejb.tree.BranchBean.ejbCreate(BranchBean.java:42)
         at com.armanta.ejb.tree.Branch_y1m5sk_Impl.ejbCreate(Branch_y1m5sk_Impl.java:255)
         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:597)
         at weblogic.ejb.container.manager.ExclusiveEntityManager.create(ExclusiveEntityManager.java:775)
         at weblogic.ejb.container.manager.ExclusiveEntityManager.remoteCreate(ExclusiveEntityManager.java:746)
         at weblogic.ejb.container.internal.EntityEJBHome.create(EntityEJBHome.java:272)
         at com.armanta.ejb.tree.Branch_y1m5sk_HomeImpl.create(Branch_y1m5sk_HomeImpl.java:79)
         at com.armanta.ejb.tree.TreeMasterBean.addBranchesToTree(TreeMasterBean.java:430)
         at com.armanta.ejb.tree.TreeMaster_n4wp5c_EOImpl.addBranchesToTree(TreeMaster_n4wp5c_EOImpl.java:800)
         at com.armanta.ejb.tree.TreeMaster_n4wp5c_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
    ; nested exception is:
         java.lang.IllegalAccessError: tried to access class oracle.jdbc.driver.OracleResultSet from class com.armanta.ejb.gen.DefaultASHelper
         at com.armanta.ejb.tree.TreeMasterBean.addBranchesToTree(TreeMasterBean.java:442)
         at com.armanta.ejb.tree.TreeMaster_n4wp5c_EOImpl.addBranchesToTree(TreeMaster_n4wp5c_EOImpl.java:800)
         at com.armanta.ejb.tree.TreeMaster_n4wp5c_EOImpl_WLSkel.invoke(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.invoke(BasicServerRef.java:589)
         at weblogic.rmi.cluster.ClusterableServerRef.invoke(ClusterableServerRef.java:230)
         at weblogic.rmi.internal.BasicServerRef$1.run(BasicServerRef.java:477)
         at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:363)
         at weblogic.security.service.SecurityManager.runAs(Unknown Source)
         at weblogic.rmi.internal.BasicServerRef.handleRequest(BasicServerRef.java:473)
         at weblogic.rmi.internal.wls.WLSExecuteRequest.run(WLSExecuteRequest.java:118)
         at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
         at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

    We ultimately found out what the issue was. Turns out that OracleResultSet moved from oracle.jdbc.driver into oracle.jdbc starting with ojdbc6.jar. We were referencing the oracle.jdbc.driver package.

  • Problem writing a BLOB

    Hi,
    - I have some problems to write a file in a BLOB field of an Oracle 9i database.
    I don't want to use oracle.sql.BLOB class because I want my application to accept all kinds of database, so I want to use java.sql.Blob class.
    1/ First I create a record in the database with an empty value for the BLOB field
    2/ Then I retrieve the record just created
    3/ I want to write in the BLOB field
    There is the code for the third part, which occurs an exception :
    java.sql.Blob myBlob = (java.sql.Blob) rs.getBlob(1);
    File f = new File("c:\\myFile.txt");
    FileInputStream fis = new FileInputStream(f);
    OutputStream os = myBlob.setBinaryStream(0);
    int length=-1;     
    while((length=fis.read())!=-1) {     
       os.write(length);
    }The exception occurs on the line : "OutputStream os = myBlob.setBinaryStream(0);"
    There is the exception :
    java.sql.SQLException: Fonction non prise en charge
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
    at oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:689)
    at oracle.sql.BLOB.setBinaryStream(BLOB.java:1007)
    Any idea ?
    - another question I have.
    When I retrieve my Blob from the database, I'm using the getBinaryStream() of the Blob class. This method returns always an OracleBlobInputStream, is there any way to retrieve a "standard" java object, and not a specific oracle object ?
    Thanks in advance for your help,
    Steve

    Hello,
    i would not get the OutputStream by calling the Method "OutputStream os = myBlob.setBinaryStream(0);".
    I use the Method "blobDest.getBinaryOutputStream();"
    Unfortunately, it's not possible to use the abstract JDBC driver interface to set a BLOB (unlimited size) into a oracle database, or rather i don't how to do it...
    Here is the code which i use to insert a inputstream to a blob. Please note: In this example a string-type is used for the ID. This might be adapted in your solution....
    public static void setBlob(Connection connection, InputStream inputStream, String tableName,
    String columnName, String recordID) throws SQLException, IOException
    Statement statement = connection.createStatement();
    ResultSet resultSet = statement.executeQuery("SELECT ID, "+columnName+" FROM "+tableName+" WHERE ID='"+recordID+"' FOR UPDATE");
    resultSet.next();
    oracle.sql.BLOB blobDest = (oracle.sql.BLOB) ((OracleResultSet) resultSet).getBlob(2);
    byte[] buffer = new byte[ blobDest.getBufferSize() ];
    OutputStream outputStream = blobDest.getBinaryOutputStream();
    int length = -1;
    while ((length = inputStream.read(buffer)) != -1) {
    outputStream.write(buffer,0,length);
    outputStream.flush();
    statement.close();
    outputStream.close();
    inputStream.close();
    resultSet.close();
    Hope it's help
    best regards
    sschoenig

  • Writing multiple BLOB (PDF) records into one PDF file

    I currently have a procedure that writes an individual BLOB pdf row and outputs it to a PDF file, however I would like to write multiple BLOB rows into one PDF.
    Oracle version:10g R2.
    Does anyone know whether it is possible to do this?
    Here is my code, I was hoping to use a cursor FOR LOOP to read the BLOB records. The BLOB records do successfully load into a new PDF file, however when you open it the PDF only the first page is viewable. I am assuming the issue is to do with the PDF format rather than writing the data out to the file. I.e. the Page numbers etc.., incorrect formatting of the PDF?
    declare
    -- Test statements here
    b BLOB;
    amount BINARY_INTEGER;
    file_handle UTL_FILE.FILE_TYPE;
    l_pos INTEGER := 1;
    l_blob_len INTEGER;
    l_buffer RAW (32767);
    l_amount BINARY_INTEGER := 32767;
    file_name_ VARCHAR2(200);
    pattern_id_ VARCHAR2(200) := '5555555';
    pdf_path_ VARCHAR2(200) := 'PDF_OUT';
    cursor get_blob_recs is
    select pdf from mds_remote_pdf_tmp;
    BEGIN
    file_name_ := to_char(pattern_id_)||'.PDF';
    file_handle := UTL_FILE.FOPEN(pdf_path_,file_name_,'wb');
    FOR rec_ IN get_blob_recs LOOP
    l_blob_len := DBMS_LOB.getlength (rec_.pdf);
    l_pos := 1;
    WHILE l_pos < l_blob_len
    LOOP
    DBMS_LOB.READ (rec_.pdf, l_amount, l_pos, l_buffer);
    UTL_FILE.put_raw (file_handle, l_buffer, FALSE);
    l_pos := l_pos + l_amount;
    END LOOP;
    END LOOP;
    UTL_FILE.FCLOSE(file_handle);
    end;
    Any advice would be greatly appreciated.
    Regards,
    David.

    I guessed there was more to a PDF file format than just amending the BLOB objects!. I think I'll have to create a function with an IN param containing the PDF file list, and invoke a Java class to merge the PDFs in the OS.
    My requirement is to record the history of when a hand written form was completed. E.g. a user might complete half a document one day, and the rest of the document another day, therefore I want one PDF with two pages of the same form at different stages of completion. These forms are currently being created as two separate PDFs, and the problem is I am restricted to displaying only one PDF!
    Thank you.
    David.
    Edited by: david.massey on Jan 26, 2011 8:16 AM

  • ITunes re-writing id3 tags with deleted / edited information

    Help I think I'm going insane. I keep my iTunes music folder on a LaCie 160 gig Rugged drive. iTunes keeps on re-writing id3 tags on certain files with information I have previously deleted or changed. This info auto fills as soon as I play the file again. I'm not using any other application to change tags.
    Also if I reset the music library location and then put it back to the external drive it finds loads of new files without me adding.
    Any idea what is going on here? Totally confused. Ghost in the system! Is it cofusing 2 databases? There's only 1 iTunes library file in the folder.

    There is a setting in iTunes.
    'Automatically download missing album artwork'. In the past that interfered with anything not being complete. Is it switched on?
    The second reason is when you get MP3 files from a PC and the details were added through XP itself, updating it in Winamp would give all kinds of problems, perhaps a similar thing is happening here.
    There is no real solution. The only solution that worked in my past was to clean out the details and enter them again, but NOT through the file manager of XP.

  • Writing to socket with setinterval not working in windows

    Hello Everyone,
    I'm trying to stream a big file to my server, and was using 'setInterval' just fine to slowly upload it from OS X, but when I moved my AIR application to a Windows Vista computer, it no longer worked. I started doing some investigation and found out that 'socket.writeBytes' function was not working inside of 'setInterval'. I then moved the code inside of 'setInterval' to outside of it and everythink worked, but obviously it was no longer streaming. Thinking there was something wrong with 'setInterval', I tried it  without the 'socket.writeBytes' function in it, and it started working fine.
    Not sure what is happening, but it seems like a bug in the air.Socket code.
    Here is my code:
        var socket = new air.Socket();
        socket.addEventListener(air.Event.CONNECT, function(e) {
            var stream = setInterval(function() {
                   socket.writeBytes(filePart, 0, filePart.length);
                    if (isDone) {
                        clearInterval(stream);
            }, 1000);
        socket.connect("myServer", 80);
    P.S. I also tried using 'air.Timer' and it was the same behavior as 'setInterval'.
    Thanks for any help.

    Hi,
    You should use the flush method:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/Socket.html#f lush%28%29
    "Flushes any accumulated data in the socket's output buffer.
    On some operating systems, flush() is called automatically between execution frames, but on other operating systems, such as Windows, the data is never sent unless you call flush() explicitly. To ensure your application behaves reliably across all operating systems, it is a good practice to call the flush() method after writing each message (or related group of data) to the socket."
    I hope this helps!
    -Erica

  • Reading and Writing to blob column is very slow

    Hi
    I want to write a serialized java object called 'engine' to a database table called javaObjectsDB. The serialized object could be of sizes anywhere between 20MB to 4GB. I am using the following code to write this 'engine' object
                   * Write java object to BLOB in DB - Start
                   Connection conn=null;
                   conn = Util.getConnectionFromDS();
              PreparedStatement ps=null;
              String sql=null;
                   Engine.startWatch();
                   ByteArrayOutputStream baos = new ByteArrayOutputStream();
                   Engine.endWatch("Time for ByteArrayOutputStream");
                   Engine.startWatch();
                   ObjectOutputStream oos = new ObjectOutputStream(baos);
                   Engine.endWatch("Time for ObjectOutputStream");
                   Engine.startWatch();
                   oos.writeObject(this.engine_);
                   Engine.endWatch("Time for oos.writeObject");
                   oos.flush();
                   Engine.startWatch();
                   byte[] data = baos.toByteArray(); // in case of using ByteArrayOutputStream
                   Engine.endWatch("Time for toByteArray");
                   Engine.startWatch();
         sql="insert into javaObjectsDB values (?)";
         ps=conn.prepareStatement(sql);
         ps.setObject(1, data); // in case of using ByteArrayOutputStream
         ps.executeUpdate();
         Engine.endWatch("Time for prepare statement and insert");
                   * Write java object to BLOB in DB - End
    To read from database BLOB column back to the engine object I use the following code:
    try {
                   String readBlob = "SELECT javaObject FROM javaObjectsDB ";
                   Statement readBlobStmt = conn.createStatement();
                   ResultSet resultSet = readBlobStmt.executeQuery(readBlob);
                   while (resultSet.next()) {
                        * ByteArrayStream *** Start
                        Engine.startWatch();
                        Blob blob = resultSet.getBlob(1);
                        Engine.endWatch("loadPlan::Time for getBlob");
                        Engine.startWatch();               
                        byte [] data = blob.getBytes(1,(int)blob.length());
                        Engine.endWatch("loadPlan::Time for getBytes");                    
                        Engine.startWatch();
                   ByteArrayInputStream bais = new ByteArrayInputStream(data);               
                   Engine.endWatch("loadPlan::Time for ByteArrayInputStream");
                   Engine.startWatch();
                   ObjectInputStream oin = new ObjectInputStream(bais);
                   Engine.endWatch("loadPlan::Time for ObjectInputStream");
                   Engine.startWatch();
                   engine_ = (Engine)oin.readObject();     
                   Engine.endWatch("loadPlan::Time for oin.readObject");
                   System.out.println("engine object prepared");
                        * ByteArrayStream *** End
                   } //while of result Set
    The time taken to write and read for a engine object of size 124MB are:
    write - 41secs
    read - 28secs
    For a engine object of size 340MB
    write - 3minutes
    read - 1minute
    This is a lot of time for such small object size, and since we are expecting sizes of 4GB, I need to have better performance. Please suggest what I can do to improve performance for read and write.
    One thing I tried was using cached lobs but not of much use.

    Welcome to the forum!
    Unfortunately this is an Oracle forum and your question should be posted in the Java JDBC forum.
    https://forums.oracle.com/forums/category.jspa?categoryID=288
    Please create a question on the JDBC forum, post a link to that new question here, in this forum, and mark this question answered.
    That way anyone seeing this question can followup with you in the other forum.
    Thanks.

Maybe you are looking for

  • What's wrong my iPhone 4? (See picture)

    Here's a picture of it: It was used on T Mobile with a Gevey. The slider doesn't say slide to unlock, it says slide for emergency calls only. I have an activated AT&T SIM card since my wife has an activated 3GS with them and I have a microSIM cutter

  • I bought a new computer and now my IPad won't snc

    I bought a new Apple laptop and now my IPad won't sync. It shows up on the left side but when I try to sync it, it says the apps installed can not be deternined. Does anyone have any idea what my problem is? Thanks in advance.

  • Issue with update to 10.6.5 and WIFI connection

    I have been having an ongoing issue with my MBP over the last 6 months and even more consistently within the last several weeks. I have searched the other posts and I think that I might be making a connection here. So, please chime in if you have any

  • Exception/error messages from remotely deploying sun application server 8.2

    Hi I have a solaris network with some servers running sun application server 8.2. When I deploy applications to these application servers (using ant) from a single server connected to them on the netwrok, sometimes exceptions are thrown. What is done

  • Information on upgrade path for Oracle CRM 11.5.10.2 to Release 12

    Hi, We are on Oracle EBS 11.5.10.2 I want to know how to upgrade Oracle CRM from 11.5.10.2 to Release 12. I have gone through Metalink note# 1081433.1 which states how to apply Oracle Customer Relationship Management Release 12.1.3 (R12.CC_PF.B.DELTA