RDB BLOB problem

Hi.
I have problem writing blob into RDB database table via JDBC driver. I use setBinarySteam() or setBytes() method in PreparedStatement.
If table has NOT NULL constraint on blob-field I'm trying to write JDBC driver throws exception:
java.sql.SQLException: in <rdbjdbcsrv:execute_into>
%RDB-E-INTEG_FAIL, violation of constraint NEW_BLOB_TABLE_NOT_NULL1 caused operation to fail
-RDB-F-ON_DB, on database DKB1:[PRO_DB.MB_DATABASE]MB.RDB;1
@rdb.Client.ExecuteInsert
     at oracle.rdb.jdbc.common.BasicClient.throwException(BasicClient.java:1049)
     at oracle.rdb.jdbc.common.BasicClient.throwException(BasicClient.java:1014)
     at oracle.rdb.jdbc.common.Client.ExecuteInsert(Client.java:498)
     at oracle.rdb.jdbc.rdbThin.Rdb.ExecuteInsert(Rdb.java:332)
     at oracle.rdb.jdbc.common.ResultSet.doStatement(ResultSet.java:5894)
     at oracle.rdb.jdbc.common.PreparedStatement.execute(PreparedStatement.java:1331)
     at oracle.rdb.jdbc.common.PreparedStatement.executeUpdate(PreparedStatement.java:399)
     at org.apache.tomcat.dbcp.dbcp.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:101)
     at ru.teleform.reportgenerator.db.ReportBroker.setBinaryStream(ReportBroker.java:188)
     at ru.teleform.reportgenerator.servlets.test.doPost(test.java:18)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
     at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:174)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)
     at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:151)
     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:870)
     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:665)
     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:528)
     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)
     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:685)
     at java.lang.Thread.run(Thread.java:619)
But if there is no constraint on this field everyyhing is ok. I'm using thin JDBC-driver.
I don't know what to do.

No, I'm not trying to set null value to this field.
For experiment I created two similar tables. One was created with NOT NULL constraint for blob column and the other one without.
And I execut identical insert-query on both of them. With first table query throws exception. And with second one everything is fine, query inserts correct data into this table.

Similar Messages

  • Re: WebLogic RDB jdbc problem

    Hi Joe,
    I tried the two things you asked:
    1. Setting the initial and max capacity of the Connection Pool to 1 does not make
    any further difference, the reselt set is still sometimes empty.
    2. If I use the code from the stand-alone application (thus if I get the connection
    directly from the driver) than I get a good result: the retrieved result set is,
    as far as I can see, always correctly filled.
    In addition I tried to cast the Connection to WLConnection and then get the vendor
    connection from it, and than to proceed with this connection further on, but this
    did not make it any better.
    Almir.
    Joe Weinstein <[email protected]> wrote:
    >
    >
    Almir wrote:
    Hi Joe,
    thanks for your quick answer to my questions. I red your sugestionsand tried
    them out but unfortunately it did not make me come any further in searchfor answer
    to this odd problem. Setting the statement cache size to 0 (I've alreadytried
    this before your response) did not make any difference at all. Refreshingthe
    statement before reuse neighter.
    I also tried to make the stand-alone application to go wrong. But nomatter whether
    I reuse connection and/or statement or whether I instantiate the newones every
    time, the execution of the statement always comes back with a validand filled
    ResultSet.
    Interesting thing to mention aboout executing the statement withinthe server
    is that if I put it in a loop of let say 100 repeats, it succeeds orit fails
    all 100 times. Next time i execute this bean method where the loopis situated
    it will again succeed or fail all 100 times. It remains consequentwithin the
    same loop/bean method. Even if I get the data source and the connectionevery
    time again (100 times) it remains consequent. Thi is maybe interestingfinding
    but it does not say anything to me. Perhaps you can make some conclusionsout
    of it.
    Best regards,
    Almir.Hmmmmm.... Interesting. The only other thing I can suspect is that the
    driver
    is not threadsafe... Would you try these two experiments?
    1 - Alter the weblogic server to define the pool to have only one connection,
    ie: initial capacity = 1 and max capacity = 1. Let me know if the
    problem
    is still there.
    2 - Alter the application code you run in the server to get a connection
    directly
    from the driver, just like the standalone code.
    Let me know...
    Joe
    Joe Weinstein <[email protected]> wrote:
    Hi Almir.
    I highly suspect the RDB driver of a bug where re-using a given Prepared
    Statement
    will sometimes produce an empty result set. Weblogic will cache your
    prepared statements
    so when you call prepareStatement() we may transparently return you
    a
    previously-used
    statement for the same SQL and arguments.
    To prove my theory, please do these two things:
    1 - Define your pool's statement cache to be of size zero. This should
    make the problem
    go away.
    2 - In a standalone program, you can create a given PreparedStatement,
    and rerun it in
    a loop, and see if it ever returns an empty result set. I will showyou
    how to include
    the code we do to refresh the statement before reuse:
    try
    Class.forName ("oracle.rdb.jdbc.rdbThin.Driver");
    Connection conn = DriverManager.getConnection("jdbc:rdbThin://<database_name>","<user>",
    "<pass>");
    String sqlStatement = "SELECT TABEL1.COLUMN1, TABEL1.COLUMN2,
    TABEL2.COLUMN1
    FROM TABEL1, TABEL2 WHERE (TABEL2.COLUMN2= TABEL1.COLUMN3) AND (TABEL2.COLUMN1
    = ?)ORDER BY TABEL1.COLUMN1";
    PreparedStatement ps = conn.prepareStatement(sqlStatement,
    ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    for (int i = 0; i < 100; i++)
    ps.setObject(1, new Integer(1));
    boolean result = ps.execute();
    ResultSet rs = ps.getResultSet();
    // check result set here
    rs.close();
    cleanUpStatementForReUse(ps);
    ps.close();
    conn.close();
    catch (Exception ex)
    System.out.println(ex);
    private void cleanUpStatementForReUse(PreparedStatement p)
    try { p.clearParameters(); p.clearBatch(); } catch (Throwable ignore)
    try { p.setEscapeProcessing(true); } catch (Throwable ignore) {}
    try
    if (p.getFetchDirection() != ResultSet.FETCH_FORWARD)
    p.setFetchDirection(ResultSet.FETCH_FORWARD);
    } catch (Throwable ignore) {}
    try
    if (p.getFetchSize() != 0)
    p.setFetchSize(0);
    } catch (Throwable ignore) {}
    try
    if (p.getMaxFieldSize() != 0)
    p.setMaxFieldSize(0);
    catch (Throwable ignore) {}
    try
    if (p.getMaxRows() != 0)
    p.setMaxRows(0);
    catch (Throwable ignore) {}
    try
    if (p.getQueryTimeout() != 0)
    p.setQueryTimeout(0);
    catch (Throwable ignore) {}
    try
    p.clearWarnings();
    catch (Throwable ignore) {}
    Almir wrote:
    Hello everybody,
    we are developing an application for Bea WebLogic Application Server8.1. This
    application uses data from an existing database. This is an OracleRDB 7-1.220
    database. Because the WebLogic AS does not include a JDBC driver forthis type
    of database we got one from Oracle: RDBJDBC71. I installed this driverand tested
    it by using a standalone Java application which executes a number
    of
    SQL statemens.
    This test was satisfying, no problems occured.
    Then, in order to use it within the application server, I defined
    a
    JDBC Connection
    Pool in WebLogic with corresponding Data Source. And it worked, ourapplication
    could connect with the database and execute the needed transactions.
    But after a while we noticed a realy strange problem. When a particularSELECT
    SQL stament is executed we expect a list of 6 records as result. Butsometimes
    the returned resultset is just empty. I tried this hundreds of times.No error
    or exception occurs but sometimes the response is correct and sometimesnot.
    In the first place we thought that the JDBC driver was causing thisproblem but
    then I executed the same SQL Select statement within a Java stand-aloneapplication
    (and not using the Application Server) and the result was correct.Repeating this
    hundreds of times did not change the outcome, the given resultset
    was
    always correct.
    I tried reconfigurating the Connection Pool in different ways but
    it
    did not make
    any difference: sometimes it worked and sometimes it didn't.
    Here below you can see the code samples of both implementations.
    Stand-alone:
    try
    Class.forName ("oracle.rdb.jdbc.rdbThin.Driver");
    Connection conn = DriverManager.getConnection("jdbc:rdbThin://<database_name>","<user>",
    "<pass>");
    String sqlStatement = "SELECT TABEL1.COLUMN1, TABEL1.COLUMN2,TABEL2.COLUMN1
    FROM TABEL1, TABEL2 WHERE (TABEL2.COLUMN2= TABEL1.COLUMN3) AND (TABEL2.COLUMN1
    = ?)ORDER BY TABEL1.COLUMN1";
    PreparedStatement ps = conn.prepareStatement(sqlStatement,ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    ps.setObject(1, new Integer(1));
    boolean result = ps.execute();
    ResultSet rs = ps.getResultSet();
    // Result set is here always filled!!!!
    rs.close();
    ps.close();
    conn.close();
    catch (Exception ex)
    System.out.println(ex);
    Application server:
    try
    Context ctx = new InitialContext();
    Object object = ctx.lookup(data_store_name);
    DataStore ds = (DataStore)object;
    Connection conn = ds.getConnection();
    String sqlStatement = "SELECT TABEL1.COLUMN1, TABEL1.COLUMN2,TABEL2.COLUMN1
    FROM TABEL1, TABEL2 WHERE (TABEL2.COLUMN2= TABEL1.COLUMN3) AND (TABEL2.COLUMN1
    = ?)ORDER BY TABEL1.COLUMN1";
    PreparedStatement ps = (PreparedStatement)conn.prepareStatement(sqlStatement,
    ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);
    ps.setObject(1, new Integer(1));
    boolean result = ps.execute();
    ResultSet rs = ps.getResultSet();
    // Result set is here sometimes empty !!!!
    rs.close();
    ps.close();
    conn.close();
    catch (Exception ex)
    System.out.println(ex);
    Any sugestions are welcome.
    Thanks.
    Almir.

    I have had the same problem as you with sporadic results for queries with RDB Drivers. Were you able to solve it and if so how?
    Sam Opoku-Boadu

  • Blob problem (Image storing or Currupted )

    AOA!
    I am working as a developer in a companey. we made a database for HRMS. In this database there is a table EMPLOYEE with a column PICTURE of type BLOB. We were using oracle 8i initially but when we migrate to oracle 9i, we are facing a problem in image storing. The situation is, database showing ur previously stored images (those have stored in oracle 8i) but when we save a new image in that table or any other table it seams to be saved but cannot retrived. I mean when we issue a query
    SELECT EMP_ID FROM EMPLOYEE WHERE PICTURE IS NOT NULL;
    It shows the new inserted records too (thats shows us that picture has been inserted) but when we issue query from a forms6i application it didnt show any image. In case of report, when we try to query a record which newly inserted with image, it says some thing like REPORT IS UNABLE TO SHOW IMAGE FORMATE etc.
    The situation is for all table and all schema which is indicating us may be it is some thing due to oracle 9i headen technique or due to miss managment by us. we dont have DBA in our companey.
    Please help us in this regard. We will be thankfull to you.
    Usman Rana
    Dont reply to above mantioned email my actual email account is [email protected]

    hello,
    these are very specific questions about forms and reports functionality. i would suggest you publish this
    question in the forms and reports forum.
    regards,
    philipp

  • BLOB problem (image storing or image curruption)

    AOA!
    I am working as a developer in a companey. we made a database for HRMS. In this database there is a table EMPLOYEE with a column PICTURE of type BLOB. We were using oracle 8i initially but when we migrate to oracle 9i, we are facing a problem in image storing. The situation is, database showing ur previously stored images (those have stored in oracle 8i) but when we save a new image in that table or any other table it seams to be saved but cannot retrived. I mean when we issue a query
    SELECT EMP_ID FROM EMPLOYEE WHERE PICTURE IS NOT NULL;
    It shows the new inserted records too (thats shows us that picture has been inserted) but when we issue query from a forms6i application it didnt show any image. In case of report, when we try to query a record which newly inserted with image, it says some thing like REPORT IS UNABLE TO SHOW IMAGE FORMATE etc.
    The situation is for all table and all schema which is indicating us may be it is some thing due to oracle 9i headen technique or due to miss managment by us. we dont have DBA in our companey.
    Please help us in this regard. We will be thankfull to you.
    Usman Rana
    Dont reply to above mantioned email my actual email account is [email protected]

    hello,
    these are very specific questions about forms and reports functionality. i would suggest you publish this
    question in the forms and reports forum.
    regards,
    philipp

  • Blob Problem (storing Images)

    AOA!
    I am working as a developer in a companey. we made a database for HRMS. In this database there is a table EMPLOYEE with a column PICTURE of type BLOB. We were using oracle 8i initially but when we migrate to oracle 9i, we are facing a problem in image storing. The situation is, database showing ur previously stored images (those have stored in oracle 8i) but when we save a new image in that table or any other table it seams to be saved but cannot retrived. I mean when we issue a query
    SELECT EMP_ID FROM EMPLOYEE WHERE PICTURE IS NOT NULL;
    It shows the new inserted records too (thats shows us that picture has been inserted) but when we issue query from a forms6i application it didnt show any image. In case of report, when we try to query a record which newly inserted with image, it says some thing like REPORT IS UNABLE TO SHOW IMAGE FORMATE etc.
    The situation is for all table and all schema which is indicating us may be it is some thing due to oracle 9i headen technique or due to miss managment by us. we dont have DBA in our companey.
    Please help us in this regard. We will be thankfull to you.
    Usman Rana
    Dont reply to above mantioned email my actual email account is [email protected]

    I think that both your SQL is wrong and your intended use is wrong. According to the SQL reference, the following seems to be a simplified definition that seems to match what you're trying to do. UPDATE &lt;table&gt; SET &lt;column&gt; = &lt;expr&gt;. So PROPERTIES should be a &lt;table&gt; of some kind and X should be a &lt;column&gt; of that table. This changes your PreparedStatement to *"UPDATE PROPERTIES SET X = ? WHERE NAME = ?"* Then you can do ps.setBlob(1, b) and ps.setString(2, ...). Because your statement is DML you must do ps.executeUpdate(). So your code might look something like this.
    Blob b = ...;
    String x = ...;
    ps = c.prepareStatement("UPDATE PROPERTIES SET X = ? WHERE NAME = ?");
    ps.setBlob(1, b);
    ps.setString(2, x);
    int i = ps.executeUpdate();
    The executeUpdate() returns the row count (i.e. number of rows) of your DML statement. Try that and see if it helps.

  • Blob Problem (image not store or currup in database)

    AOA!
    I am working as a developer in a companey. we made a database for HRMS. In this database there is a table EMPLOYEE with a column PICTURE of type BLOB. We were using oracle 8i initially but when we migrate to oracle 9i, we are facing a problem in image storing. The situation is, database showing ur previously stored images (those have stored in oracle 8i) but when we save a new image in that table or any other table it seams to be saved but cannot retrived. I mean when we issue a query
    SELECT EMP_ID FROM EMPLOYEE WHERE PICTURE IS NOT NULL;
    It shows the new inserted records too (thats shows us that picture has been inserted) but when we issue query from a forms6i application it didnt show any image. In case of report, when we try to query a record which newly inserted with image, it says some thing like REPORT IS UNABLE TO SHOW IMAGE FORMATE etc.
    The situation is for all table and all schema which is indicating us may be it is some thing due to oracle 9i headen technique or due to miss managment by us. we dont have DBA in our companey.
    Please help us in this regard. We will be thankfull to you.
    Usman Rana

    I have a mistake , the right code is :
    <listobject:create name="mylist" columns="field,value" />
         <listobject:addrow name="mylist">
              <listobject:argument name="field" value="historyAttr1" />
              <listobject:argument name="value" value="1234" />
         </listobject:addrow>

  • BLOB problem in forms 6i

    Hi All,
    i have a problem with BLOB data type. i just create a base table block thru wizard. i have one BLOB field in my table. i use GET_FILE_NAME and READ_IMAGE_FILE to store image in base table block field and press commit. it shows 1 transaction completed. when i query record it cannot shows any record. i checked it from SQL/PLUS, it shows no record in table (select count(*) from mytable) . when i use LONG RAW type its work. i'm using ORACLE 9i database and forms 6i rel 2.
    plz tell me what i can do in this regard.
    Thanks in advance
    Shakeel

    Hello there,
    i have created a table(with 3 columns) one blob column, i commit one record as you have said and i saved it.
    (i) The sql don't display
    (ii) On forms it is showing
    (iii) i have set item property (image), if you set any other accept except image or oracle defined then it will not display.
    with best regards,
    [email protected]

  • Blob Problem

    Hello,
    The problem that i have is that i want to insert a file residing in the network into the oracle database into a blob field and again read it from the database and show it ie either insert it into a file directly and then open it using the correct editor or open it directly. I am using java along with it but i am basically stuck on the database side.
    I am sending the code which i have written till date
    i basically need to know
    1)the syntax i am using to interact with the database is right ie where is the error in the code
    2)provided that is ok whether my overall code is on the right track.
    The error message i am getting:
    java.sql.exe:ORA-06550 line col22
    PLS 00302: Component GETCHUNKSIZE must be declared
    ORA-06550 line1 col 7
    pl/sql statement ignoured
    My developopment enviornment is JDeveloper3.0 as this code is having problems compiling in JDK as Jdeveloper overides a few of the jdk classes.
    =========================================================================
    My table structure
    CREATE TABLE DOC_MAS(
    DOC_MAS_SR_NO NUMBER(10),
    PROJECT_NAME VARCHAR2(30),
    MODULE_NO NUMBER(10),
    DOC_NAME VARCHAR2(10),
    DOC_TYPE VARCHAR2(10),
    VERSION NUMBER(10));
    CREATE SEQUENCE SEQ_DOC_MAS START WITH 1 INCREMENT BY 1;
    CREATE SEQUENCE SEQ_DOC_DETAIL START WITH 1 INCREMENT BY 1;
    CREATE TABLE DOC_DETAIL(
    DOC_DETAIL_SR_NO NUMBER(10),
    DOC_MAS_SR_NO NUMBER(10),
    DATE_OF_INSERT DATE,
    ACTUAL_DOC BFILE,
    COMMENTS VARCHAR2(500));
    ===============================================================================
    My connection code:
    public class ConnectionParams {
    // The machine on which the database resides
    //public final static String s_hostName = "insn110a.in.oracle.com";
    public final static String s_hostName = "192.168.1.1";
    // The TNS listener port
    public final static String s_portNumber = "1521";
    // The database name (SID)
    //public final static String s_databaseSID = "otndb";
    public final static String s_databaseSID = "orcl";
    // The database User ID
    public final static String s_userName = "scott";
    // The database user password
    public final static String s_password = "tiger";
    ========================================================================================
    import java.io.*;
    import java.sql.*;
    import oracle.sql.*;
    import oracle.jdbc.driver.*;
    import java.util.*;
    import java.util.Date;
    //import java.math.BigDecimal;
    public class Sample2
    Connection m_connection; //Database Connection Object
    String p_doc_name=null;
    String s_blobvariable = p_doc_name;
    public Sample2()
    dbConnection();
    public static void main(String[] args)
    Sample2 lobs = new Sample2();
    // lobs.dbConnection();
    lobs.readFileNameExt();
    /*This class is for creation of connection =========================================*/
    public void dbConnection() {
    try {
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    String l_dbConnectString =
    "(DESCRIPTION=(ADDRESS=(HOST="+ConnectionParams.s_hostName+")"+
    "(PROTOCOL=tcp)(PORT="+ConnectionParams.s_portNumber+"))"+
    "(CONNECT_DATA=(SID="+ConnectionParams.s_databaseSID+")))";
    m_connection = DriverManager.getConnection(
    "jdbc:oracle:thin:@"+l_dbConnectString,
    ConnectionParams.s_userName, ConnectionParams.s_password);
    // m_connection.setAutoCommit(false);
    System.out.println("Connection Successful");
    Thread.sleep(3000);
    } catch(Exception ex){ //Trap SQL errors
    System.out.println("Error in Connecting to the Database "+ex.toString());
    /*========================================================================================
    File inserting section of the code
    // THIS class gets the input from the file dialog box it gets the file path,projectName and the module no
    //public void readFileNameExt(String p_doc_path,String p_module_no,String p_project_name)
    public void readFileNameExt()
    String p_doc_path = "c:/warea/Mehul2/TABLE5.xls";
    int p_module_no = 10;
    String p_project_name = "Finserve";
    String p_doc_type= null;
    String p_version = null;
    StringTokenizer strtkn = new StringTokenizer(p_doc_path,"/");
    while(strtkn.hasMoreTokens())
    p_doc_name =strtkn.nextToken();
    System.out.println("The file name is" +p_doc_name);
    StringTokenizer strtoken = new StringTokenizer(p_doc_name,".");
    while(strtoken.hasMoreTokens())
    p_doc_type =strtoken.nextToken();
    try{
    System.out.println("The file Type is"+p_doc_type);
    insertDocMas(p_doc_name,p_doc_type,p_project_name,p_module_no);
    Thread.sleep(10000);
    }catch (Exception e){}
    }//end of method
    //============================================== this class is for inserting the doc_mas details in teh table along with version checking
    public void insertDocMas(String p_doc_name,String p_doc_type,String p_project_name,int p_module_no){
    int p_version = -1;
    int p_doc_mas_sr_no = -1;
    // String verision=null;
    int verision;
    String s = null;
    try{
    Statement l_stmt = m_connection.createStatement();
    ResultSet l_version_details = l_stmt.executeQuery("SELECT MAX(VERSION) FROM DOC_MAS WHERE DOC_NAME = '"+p_doc_name+"'");
    if (l_version_details.next())
    { System.out.println("The Control 1");
    verision = l_version_details.getInt(1);
    System.out.println("The Control 2 : "+verision);
    verision = verision +1;
    else {
    verision = 1;
    System.out.println("The Control 3");
    p_version = verision;
    System.out.println("The value of p_version" + p_version);
    l_version_details.close();
    l_stmt.close();
    Thread.sleep(4000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of insert"+e);
    /* try{
    Statement stmt = m_connection.createStatement();
    ResultSet rset = stmt.executeQuery("select DEPTNO,DNAME,LOC from DEPT");
    while(rset.next()){
    BigDecimal deptno = rset.getBigDecimal(1,2);
    String dname = rset.getString(2);
    // Timestamp hiredate = rset.getTimestamp(3);
    String loc = rset.getString(3);
    System.out.println(deptno+" "+dname+" "+loc);
    Thread.sleep(50000);
    }catch(Exception e){System.out.println(e);}
    try{
    Statement l_stmt = m_connection.createStatement();
    ResultSet l_seq_details = l_stmt.executeQuery("SELECT SEQ_DOC_MAS.NEXTVAL FROM DUAL");
    if (l_seq_details.next())
    p_doc_mas_sr_no = l_seq_details.getInt(1);
    System.out.println("The Control AA");
    System.out.println("The value of p_doc_mas_sr_no" + p_doc_mas_sr_no);
    l_seq_details.close();
    l_stmt.close();
    Thread.sleep(4000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of selecting the current sequence number"+e);
    try {
    System.out.println("Creating rows in DOC_MAS.. ");
    System.out.println("The Control VV");
    PreparedStatement l_pstmt = m_connection.prepareStatement("insert into DOC_MAS(DOC_MAS_SR_NO,PROJECT_NAME,MODULE_NO,DOC_NAME,DOC_TYPE,VERSION) values(?,?,?,?,?,?)");//SEQ_DOC_MAS.nextval
    l_pstmt.setInt(1,p_doc_mas_sr_no);//"SEQ_DOC_DETAIL.NEXTVAL"
    l_pstmt.setString(2,p_project_name);
    l_pstmt.setInt(3,p_module_no);
    l_pstmt.setString(4,p_doc_name);
    l_pstmt.setString(5,p_doc_type);
    l_pstmt.setInt(6,p_version);
    l_pstmt.executeUpdate(); // Execute SQL statement
    l_pstmt.close();
    System.out.println("The Control 3");
    // Close statement
    Thread.sleep(20000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of insert11"+e);
    try{System.out.println("The Control 4");
    Statement l_statement = m_connection.createStatement();
    ResultSet l_doc_mas_sr_no = l_statement.executeQuery(
    "SELECT max(DOC_MAS_SR_NO) FROM DOC_MAS "+
    "WHERE DOC_NAME = '"+p_doc_name+"' ");//FOR UPDATE
    if (l_doc_mas_sr_no.next())
    p_doc_mas_sr_no = l_doc_mas_sr_no.getInt(1);
    l_doc_mas_sr_no.close();
    l_statement.close();
    System.out.println("The Control 5");
    Thread.sleep(10000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of insert");
    loadSamples(p_doc_mas_sr_no,p_doc_name,p_doc_type);
    }//Method insertDocMas() closing here
    /*This class is for loading the data into the database==================================*/
    public void loadSamples(int p_doc_mas_sr_no,String p_doc_name,String p_doc_type) {
    int p_doc_detail_sr_no = -1;
    Date p_sysdate = new Date() ;
    try{
    Statement l_stmt = m_connection.createStatement();
    ResultSet l_seq_doc_details = l_stmt.executeQuery("SELECT SEQ_DOC_DETAIL.NEXTVAL FROM DUAL");
    if (l_seq_doc_details.next())
    p_doc_detail_sr_no = l_seq_doc_details.getInt(1);
    System.out.println("The Control AA");
    System.out.println("The value of p_doc_detail_sr_no" + p_doc_detail_sr_no);
    l_seq_doc_details.close();
    l_stmt.close();
    Thread.sleep(4000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of selecting the current sequence number"+e);
    try{
    Statement l_st = m_connection.createStatement();
    ResultSet l_date = l_st.executeQuery("SELECT sysdate FROM DUAL");
    if (l_date.next())
    p_sysdate = l_date.getDate(1);
    System.out.println("The Control sysdate");
    System.out.println("The value of p_sysdate" + p_sysdate);
    l_date.close();
    l_st.close();
    Thread.sleep(4000);
    }catch(Exception e){
    System.out.println("Exception has occured at the time of selecting the sysdate"+e);
    try {System.out.println("The Control 6");
    System.out.println("Creating row for actual-doc in DOC_DETAILS.. ");
    PreparedStatement l_pstmt = m_connection.prepareStatement("insert into DOC_DETAIL(DOC_DETAIL_SR_NO,DOC_MAS_SR_NO,DATE_OF_INSERT,ACTUAL_DOC)values(?,?,p_sysdate, empty_blob() )");
    l_pstmt.setInt(1,p_doc_detail_sr_no);
    l_pstmt.setInt(2,p_doc_mas_sr_no);
    //l_pstmt.setDate(3,p_sysdate);
    System.out.println("The Control 6AA");
    l_pstmt.execute(); // Execute SQL statement
    l_pstmt.close(); // Close statement
    System.out.println("Created.\nLoading <map.gif> into BLOB column for doc_detail...");
    System.out.println("The Control 7");
    // Retrieve the row just inserted, and lock it for insertion of the
    }catch(Exception e){
    System.out.println("Exception has occured at the time of inserting blob locators"+e);
    try {
    // LOB columns.
    System.out.println("The Control 7AAA");
    Statement l_stmt = m_connection.createStatement();
    ResultSet l_lobDetails = l_stmt.executeQuery(
    "SELECT ACTUAL_DOC "+
    "WHERE DOC_MAS_SR_NO = '"+p_doc_mas_sr_no+"'");
    // Retrieve BLOB and CLOB streams for ACTUAL_DOC and TEXT_DOC
    // columns, and load the sample files
    System.out.println("The Control 8");
    if (l_lobDetails.next())
    // Get the BLOB locator and open output stream for the BLOB
    BLOB l_mapBLOB = ((OracleResultSet)l_lobDetails).getBLOB(1);
    OutputStream l_blobOutputStream = l_mapBLOB.getBinaryOutputStream();
    System.out.println("The Control 9");
    // Open the sample file as a stream for insertion into the BLOB column
    File l_blobvariable = new File(s_blobvariable);
    InputStream l_sampleFileStream=new FileInputStream(l_blobvariable);
    System.out.println("The Control 10");
    // Buffer to hold chunks of data to being written to the BLOB.
    // In Oracle8.1.5 JDBC drivers a method getBufferSize() is available
    // in the BLOB class, that returns the optimal buffer size
    byte[] l_buffer = new byte[10* 1024];
    System.out.println("The Control 11");
    // Read a chunk of data from the sample file input stream, and write the
    // chunk to the BLOB column output stream. Repeat till file has been
    // fully read.
    int l_nread = 0; // Number of bytes read
    while ((l_nread= l_sampleFileStream.read(l_buffer)) != -1) // Read from file
    l_blobOutputStream.write(l_buffer,0,l_nread); // Write to BLOB
    System.out.println("The Control 12");
    // Close both streams
    l_sampleFileStream.close();
    l_blobOutputStream.close();
    System.out.println("Done Loading sample files");
    System.out.println("\nRetrieving and displaying sample files..");
    // Retrieve and display the LOB data just inserted
    drawBLOB(l_mapBLOB,p_doc_name,p_doc_type);
    //System.out.println("Done loading and displaying LOB data");
    } //if statement closes here
    l_lobDetails.close();// Close Result Set and statement
    l_stmt.close();
    } catch (Exception ex)
    { // Trap       SQL errors
    System.out.println("Error loading sample files for the selected airport");
    System.out.println("\n"+ex.toString());
    }//Method closes here
    * Retrieve the BLOB data from input BLOB column into a local file,
    * and draws the image. The file type needs to be added here
    public void drawBLOB(BLOB p_blob, String p_doc_name,String p_doc_type) {
    //String fileType this should be passed at some point to ensure that the file gets the right extension
    try {
    // Open a stream to read the BLOB data
    InputStream l_blobStream = p_blob.getBinaryStream();
    // Open a file stream to save the BLOB data
    FileOutputStream l_fileOutStream = new FileOutputStream(p_doc_name+"."+p_doc_type);
    // Read from the BLOB data input stream, and write to the file output
    // stream
    byte[] l_buffer = new byte[10]; // buffer holding bytes to be transferred
    int l_nbytes = 0; // Number of bytes read
    while ((l_nbytes = l_blobStream.read(l_buffer)) != -1) // Read from BLOB stream
    l_fileOutStream.write(l_buffer,0,l_nbytes); // Write to file stream
    // Flush and close the streams
    l_fileOutStream.flush();
    l_fileOutStream.close();
    l_blobStream.close();
    //m_GUI.drawMap(p_doc_name,p_doc_type);
    // Draw retrieved image to GUI
    drawMap(p_doc_name,p_doc_type);
    } catch (Exception ex) { // Trap SQL and IO errors
    System.out.println("Error in retrieving and drawing map for selected airport");
    System.out.println("\n"+ex.toString());
    * Create a label from the image filepassed, add the label to the image area
    This part will have to be modified majorly
    public void drawMap(String p_doc_name,String p_doc_type) {
    //Refer to SIRExtOpen.java
    Runtime r = Runtime.getRuntime();
    Process p = null;
    if (p_doc_type.equals("html")&#0124; &#0124;p_doc_type.equals("htm"))
    try{
    p = r.exec( "C:\\Program Files\\Internet Explorer\\Iexplore.EXE " + p_doc_name);
    //repaint();
    p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    if(p_doc_type.equals("txt")&#0124; &#0124; p_doc_type.equals("sql")&#0124; &#0124; p_doc_type.equals("java"))
    try
    p = r.exec( "C:\\WINDOWS\\notepad.EXE " + p_doc_name); p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of txt , sql , java if
    if(p_doc_type.equals("xls"))
    try
    p = r.exec( "C:\\Program Files\\Microsoft Office\\Office\\excel.EXE " + p_doc_name);p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of xls if
    if(p_doc_type.equals("fmb"))
    try
    p = r.exec( "C:\\Program Files\\Accessories\\wordpad.exe " + p_doc_name);p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of fmb if
    if(p_doc_type.equals("doc"))
    try
    p = r.exec( "C:\\Program Files\\Accessories\\wordpad.exe " + p_doc_name);p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of doc if
    if(p_doc_type.equals("mpp"))
    try
    p = r.exec( "C:\\Program Files\\Accessories\\wordpad.exe " + p_doc_name);p.waitFor();
    catch(Exception ex)
    ex.printStackTrace();
    System.out.println(ex);
    System.out.println(ex.getMessage());
    } // end of mpp if
    //Here you can write a statement for deleting the file in the root directory once the file is opened using any editor
    }//end of method
    }//This is the class closing
    * This method is called when a row is selected from the combo.
    * It checks if there exists data in DOC_DETAIL for the selected
    * file. If there exists data, it calls drawBLOB and writeCLOB to
    * display the data
    /*public void fileSelected(String p_doc_mas_sr_no,String p_doc_name,String p_doc_type) {
    try {
    System.out.println("Retrieving LOB details for selected file..");
    // Create a SQL statement
    Statement l_stmt = m_connection.createStatement();
    // Query DOC_DETAILS for the selected file
    java.sql.ResultSet l_lobDetails = l_stmt.executeQuery(
    "SELECT ACTUAL_DOC FROM DOC_DETAILS "+
    "WHERE DOC_MAS_SR_NO='"+p_doc_mas_sr_no+"'");
    // Check if LOB columns exist
    if (l_lobDetails.next()) {
    // LOB details exist
    // Display airport map and suggestion book (LOB details)
    drawBLOB(l_lobDetails.getBlob(1),p_doc_name,p_doc_type);
    //lobs.drawBLOB(((OracleResultSet)l_lobDetails).getBLOB(1),p_doc_name,p_doc_type);
    //Should this be like this
    System.out.println("Done retrieving and displaying LOB details");
    } else {
    // No LOB details
    // m_GUI.m_loadButton.setEnabled(true);
    //TO BE CHECKED OUT LATER m_loadButton This is a button in the form
    System.out.println("No airport map and suggestion book exist for selected airport");
    System.out.println("\nPress <Load Sample2 Files> to load LOB details");
    l_lobDetails.close();
    l_stmt.close();
    } catch (Exception ex) { // Trap SQL errors
    System.out.println("Error retrieving LOB Details for the selected airport");
    System.out.println(ex.toString());

    You are probably better off using BLOBs rather than BFILEs. The main reason for this is that with BLOBs data integrity between file and its meta data in the database are managed and protected by the RDBMS. BFILEs are useful for legacy systems where the files already exist in some form of meaningful and managed structure that needs to be preserved.
    There is a down side to BLOBs and that is performance - BLOBs are relatively slow to load into the database. However, its not too bad and the performance of extracting BLOBs out from the database is quite reasonable the bottleneck is more likely to be your LAN.
    In order to use BLOBs it is important to have the right class libraries involved. For BLOBs you must use the classes12.zip (supplied with the database) for JDBC2 support and furthermore put this class high up the list of class libraries if you do not you may find that your code compiles but raises a runtime exception about invalid data types; this is because the wrong definition of the Blob class is being picked up.
    Assuming that you are using BLOBs then the following describes the techniques for storing files as BLOBs in an Oracle database.
    LOADING BLOBS
    Assuming that you have a table with a BLOB column in it then to load a BLOB you must first create the record containing the BLOB by inserting a row into your table with the value of the BLOB column set to EMPTY_BLOB( ) (PL/SQL built in):
    INSERT INTO tablex( col1, col2, colBLOB )
    VALUES( val1, val2, EMPTY_BLOB() )
    Then you must row lock this record and obtain the LOB locator for the BLOB just created:
    stmt = connection.createStatement();
    query = "SELECT colBLOB FROM tablex WHERE ... FOR UPDATE OF colBLOB";
    ResultSet lockLOBSet = stmt.executeQuery(query);
    At this point you should be able to use lockLOBSet.getBlob(1) to create a binary stream to load the BLOB directly into the database. Under Java Developer 2 I could never get this to work and havent tried since with Java Developer 3. Instead I used the PL/SQL DBMS_LOB package and did it using JDBC; this assumes that the file has been loaded into a buffer binaryFile and note that the maximum chunk size that dbms_lob.write can be called with is 32K:
    blobLoc = lockLOBSet.getBlob(1);
    while(amountWritten < fileSize)
    if ((amountWritten + writeAmount) <= fileSize)
    writeAmount = 32000;
    else
    writeAmount = fileSize - amountWritten;
    System.arraycopy(binaryFile, amountWritten, buffer, 0, writeAmount);
    CallableStatement cstmt =
    connection.prepareCall("{call dbms_lob.write(?, ?, ?, ?)}");
    cstmt.setBlob(1, blobLoc);
    cstmt.setLong(2, writeAmount);
    cstmt.setLong(3, amountWritten + 1);
    cstmt.setBytes(4, buffer);
    cstmt.execute();
    cstmt.close();
    amountWritten = amountWritten + writeAmount;
    EXTRACTING BLOBS
    Binary streams do work when it comes to reading BLOBs out of the database so things are a whole lot simpler probably worth trying it with loading BLOBs now as well.
    ResultSet queryLOBSet = statement.executeQuery(query);
    if(queryLOBSet.next())
    lobSize = queryLOBSet.getInt(1);
    blobLoc = queryLOBSet.getBlob(2);
    BufferedInputStream bi;
    blobBuffer = new byte[lobSize];
    bi = new BufferedInputStream(blobLoc.getBinaryStream());
    amountRead = bi.read(blobBuffer);
    bi.close();
    Regards,
    Bob
    null

  • Asp blob problem?

    Hi All,
    i upload an image from asp to blob field,but i can't display the image in asp.
    while i write an image from vb to blob ,i can display the image.
    i have read the sample code Use interMedia with OO4O and Microsoft IIS to load and retrieve rich content in InterMedia sample. the code have the same problem.
    i don't know what to do.
    help me.
    thanks

    I am using 2.2. It outputs the folowing html
    <a id="ad" href="http://portaldev.cmcinet.org/portal/server.pt/gateway/PTARGS_0_612_546_208_0_43/http%3B/portaldev.cmcinet.org/cmcportlets/adbanner/webform2.aspx">
    <img src="http://portaldev.cmcinet.org/portal/server.pt/gateway/PTARGS_0_612_546_208_0_43/http%3B/portaldev.cmcinet.org/cmcportlets/adbanner/image.jpg" alt="Community Medical Organisation" border="0" /></a>
    I believe they work different from imagebuttons. Just crate a page and add an adrotator control to it and read the images from some xml file. I can send you the code.

  • A J2EE problem from an International Bank EJB-RDB remapping problem

    Background Information:
    We are going to deploy a J2EE project with DB2 V7.1 as the backend database server. However, the project is developed using WSED and initially assumed DB2 V.8 will be used as the database server. The inconsistency of DB2 version have us to make some amendments on the project. To simplify the scenario, what we do is to truncate the table/column name with length >18 to 18 defined in all .tblxmi, ... for EJB-RDB mapping. After we rebuild the project and deploy it in WAS 5.1, the following error occured,
    CNTR0020E: Non-application exception occurred while processing method "populateSystemCache" on bean "BeanId(eFOSt
    0#eFOS-Session.jar#SystemService, null)". Exception data: javax.ejb.TransactionRolledbackLocalException: ; nested exception is: com
    .ibm.db2.jcc.DB2SQLException: DB2JDBCCursor Received Error in Method prepare:SQLCODE==> -107 SQLSTATE ==> 42622 Error Tokens ==> <<D
    B2 7.1 SQLJ/JDBC>> "ACTUAL_MONTH_END_DATE" 18
    com.ibm.db2.jcc.DB2SQLException: DB2JDBCCursor Received Error in Method prepare:SQLCODE==> -107 SQLSTATE ==> 42622 Error Tokens ==>
    <<DB2 7.1 SQLJ/JDBC>> "ACTUAL_MONTH_END_DATE" 18
    at COM.ibm.db2os390.sqlj.jdbc.DB2SQLJJDBCCursor.setError(DB2SQLJJDBCCursor.java:1232)
    at COM.ibm.db2os390.sqlj.jdbc.DB2SQLJJDBCSection.prepare(DB2SQLJJDBCSection.java:767)
    at COM.ibm.db2os390.sqlj.jdbc.DB2SQLJConnection.prepareStatement(DB2SQLJConnection.java:1470)
    at COM.ibm.db2os390.sqlj.jdbc.DB2SQLJConnection.prepareStatement(DB2SQLJConnection.java:1580)
    We are sure that we have made all the necessary truncations for the table/column. We discovered that some of the .class file, e.g. SystemBeanFunctionSet_71684028.class, was generated under the directory ../websphere_deploy/DB2UDBOS390_V71_1 after we rebuild the project. Many column names with length >18 were found there, such as ACTUAL_MONTH_END_DATE.
    PreparedStatement pstmt = null;
    try
    pstmt = prepareStatement(connection, "INSERT INTO FAK.SYSTEM (SYSTEM_CODE, ACTIVE_FLAG, SYSTEM_NAME, BUSINESS_DATE, LAST_BUSINESS_DATE, NEXT_BUSINESS_DATE, REGION_CODE, MONTH_FLAG, ACTUAL_MONTH_END_DATE, LOCAL_COMPANY_CODE, LOCAL_BRANCH_CODE, LOCAL_COUNTRY_CODE, LOCAL_CURRENCY_CODE, FUNDING_CURRENCY_CODE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)");
    String tempString = (String)inputRecord.get(0);
    May I know what those .class file (with number prefix in the file name)for and how can we solve the problem?
    Thanks a lot

    Put it simply, is there any method using WSED to
    deploy the project using DB2 V.7.2 if the project is
    assembled using DB2 V8 and no java source is
    available ???If you are not making use of any functions specific to DB2 V8 how does it matter for you? The difference only lies in the DataSource configuration or something like that but certainly not on your java code(If you have not done anything specific to V8).Your problem sounds me like as suggested you have an extra/lesser parameters(?) or checkout the parameter that you are passing in is not overflowing any columns.

  • 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

  • 2.3.0b3 and PointBase Blob problem.

    The schema tool generates a BLOB with a maxsize of 1 byte in PointBase for
    fields with the "blob" extension. This is of course too small, and results
    in a "data right truncation" exception (from PointBase), when an insert is
    attempted. The column-length extension element does not affect the BLOB
    size. Is there some workaround?
    -Maciej Szefler

    I'm experiencing some additional problems with PointBase. It seems that the
    "drop" action in schema tool does not work correctly (the syntax for
    dropping the indexes is incorrect):
    $ schematool -action drop classes/com/fs/wf/impl/jdo/package.jdo
    Exception in thread "main" java.sql.SQLException: Expected to find "."
    instead f
    ound "end of SQL command" at position 41.
    at com.pointbase.dbexcp.dbexcpException.getSQLException(DashOB3242)
    at com.pointbase.jdbc.jdbcStatement.executeQuery(DashOB3242)
    at com.pointbase.jdbc.jdbcStatement.executeUpdate(DashOB3242)
    at
    com.solarmetric.kodo.impl.jdbc.datasource.StatementImpl.executeUpdate
    (Unknown Source)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.executeSQL(Unknown Source)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.dropTable(Unknown Source)
    at
    com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.dropTables(Unknown Source)
    at com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.drop(Unknown
    Source)
    at com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(Unknown
    Source)
    at com.solarmetric.kodo.impl.jdbc.schema.SchemaTool.main(Unknown
    Source)
    The SQL that caused this error is:
    DROP INDEX REQUESTJDOIMPL__RESPONSESXJDOX;
    DROP INDEX REQUESTJDOIMPL__RESPONSESX_REX;
    DROP TABLE REQUESTJDOIMPL__RESPONSESX;
    DROP TABLE REQUESTJDOIMPLX;
    DELETE FROM JDO_SCHEMA_METADATAX WHERE CLASSNAMEX =
    'com.fs.wf.impl.jdo.RequestJdoImpl';
    DROP INDEX RESPONSEJDOIMPL__PAYLOADXJDOIX;
    DROP TABLE RESPONSEJDOIMPL__PAYLOADX;
    DROP TABLE RESPONSEJDOIMPLX;
    DELETE FROM JDO_SCHEMA_METADATAX WHERE CLASSNAMEX =
    'com.fs.wf.impl.jdo.ResponseJdoImpl';
    This problem is not that big of a deal since dropping the tables drops the
    indexes, but the BLOB column creation issue is a big pain because I have to
    rewrite the SQL in order to increase the BLOB size.
    "Maciej Szefler" <[email protected]> wrote in message
    news:[email protected]...
    The schema tool generates a BLOB with a maxsize of 1 byte in PointBase for
    fields with the "blob" extension. This is of course too small, and results
    in a "data right truncation" exception (from PointBase), when an insert is
    attempted. The column-length extension element does not affect the BLOB
    size. Is there some workaround?
    -Maciej Szefler

  • BLOB Problems

    Hi,
    Tough problem it seems.
    I have a database with BLOB datatype and various files of various formats like pdf, office, txt.
    Most of these files blob are properly displayed using the following PHP script
    <?
    $conn = OCILogon ("","","");
    $sql = "";
    $stmt = oci_parse($conn, $sql);
    oci_execute($stmt)
    or die ("Unable to execute query");
    while ($row = oci_fetch_array($stmt)) {
    $id = $row['0'];
    $blob = $row['1'];
    $filename = $row['2'];
    header("Content-type: application/octet-stream");
    header("Content-disposition: attachment; filename=$filename");
    echo "$blob -> readfile()";
    OCIlogoff ($conn);
    ?>
    When the display doesn't work, I have the following characters displayed.
    JAL Ø 'Oh3Â.
    Ä4á Bá Øp | €ÏðH
    # a'hÐ !
    C# ¸«ýÿ
    Ã% Ùt¾a1(TM)Læ"Y'Þq9 Nç"Ùôþ A¡Pè"Z5 Ø¥'€ b H ð /áò m@ - ÂÁÀ ª¾à X£öP 0 'P' ª9oZ%¢vk'~P ²ÞooûÕÞ l# ¤°Ü$/ fÂÃ18l^"J » ±õèÌ8Å--+æaùË<0Ý--
    The most probable problem would be the Byte Order Mark problem known from PHP http://bugs.php.net/42312 but I am not sure.
    I just don't get it. The enconding of the database is ISO. Why some documents are absolutely fine, why some are not?
    Any help would be very much appreciated.
    Edited by: user13013984 on 21 avr. 2010 13:10

    Hi
    Thanks for replying. Data storage seems fine, I have a data presentation issue. The binary cannot be read, the file format isn't recognized.
    When I try the SQL you submitted I get this :
    Erreur SQL : ORA-00932: types de données incohérents : NUMBER attendu ; BINARY obtenu
    00932. 00000 - "inconsistent datatypes: expected %s got %s"
    For example, some word documents stored as long raw work perfectly fine, some cannot be read. No txt files can be read. Some Excel files work fine, some don't.
    There are no Office versions differences between them.
    Is there any tool/code capable of reading any long raw datatype?

  • OraOLEDB provider 8.1.7.3 - BLOB problem

    Hi,
    We are using Oracle Provider OraOLEDB 8.1.6 earlier and BLOB is reading Properly...Now I upgraded the provider to OraOLEB 8.1.7.3...Now all BLOB/LONG fields are read as NULL...Same code works perfectly fine with OraOLEDB 8.1.6...
    Did we have to change any where specifically for reading BLOB in the case of OraOLEDB 8.1.7.3?
    Can anyone help since this is very urgent for my develoment work...
    Regards
    Zunil

    oh ... I forgot to say ..
    when I run query under Enterprise Manager as
    select * from Openquery (db, 'select * from table')
    then it will show me a pop-up message
    "Query Designer encountered a MS Design Tools error:
    ODBC error: [Microsoft][ODBC SQL Server Driver][SQL Server]OLE DB provider 'OraOLEDB.Oracle' reported an error.
    [Microsoft][ODBC SQL server Driver][SQL Server][OLE/DB provider returned message: ORA-12545: Connect failed because target host or object does not exist]
    And I follow support.microsoft.com/support/complus/mtsandoracle.asp?SD=GN&LN=EN-US&gssnb=1,setting as follow
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC\MTxOCI]
    "OracleXaLib"="oraclient8.dll"
    "OracleSqlLib"="orasql8.dll"
    "OracleOciLib"="oci.dll"

  • Insert BLOB problem

    Hi:
    I'm using oracle 8.1.6 on SunOS 5.7.
    I tried to insert a MS Word file into a blob column, but failed.
    Following are what I did:
    create table test
    (id number primary key,
    text blob
    insert into test (id,text) values (1,empty_blob());
    create directory filedir as '/home/mydir';
    Declare
    lobd BLOB;
    fils BFILE;
    BEGIN
    fils := BFILENAME('filedir','test.doc');
    SELECT text INTO lobd FROM test WHERE id = 1 FOR UPDATE;
    dbms_lob.fileopen(fils, dbms_lob.file_readonly);
    dbms_lob.loadfromfile(lobd, fils, dbms_lob.getlength(fils));
    COMMIT;
    dbms_lob.fileclose(fils);
    END;
    I got error message:
    DECLARE
    ERROR at line 1:
    ORA-22285: non-existent directory or file for FILEOPEN operation
    ORA-06512: at "SYS.DBMS_LOB", line 475
    ORA-06512: at line 7
    The file test.doc is at that directory /home/mydir. I tried to replace
    'filedir' with '/home/mydir' in the line
    fils := BFILENAME('filedir','test.doc');
    but still no success.
    Could anyone give me some advices?
    Thanks,
    George

    Hi Omar,
    Could anyone tell me how to insert a file (say a word doc., or a PDF or a text document) into a column of a table of type BFILE or BLOB. I know that it is possible to map to the physical file on the filesystem thru logical directory creation. But, would like to know how to insert a file into the column and use it later for retireval, string searching, etc. from the queries. Is it thru SQL*Loader? Could u explain me(with example, if poss.) how to do this with the loader utility?
    Pls guide me thru this.
    Thanks!
    Regards,
    Sanjay

Maybe you are looking for