CMP EJB CLOB/BLOB retrieval issues from Oracle through JBoss

I have some EJB 2.0 CMP Entity Beans, deployed on a JBoss 3.07 application server.
In some of my beans I have Strings that I would like to map to a CLOB in my database as the Strings could easily be more than 4000 characters, and some byte arrays that I would like to map to a BLOB in my database to store files.
When I use PostgreSQL as my datastore in JBoss I can store and retrieve data from my CLOBs and BLOBs just fine.
However when I use an Oracle 9i (9.0.1) database for my datastore, I can write the information to the CLOB/BLOB fields (I can see it when I manually check the tables), but for some reason I cannot retrieve the information when I load my beans. The fields that map to the CLOB/BLOB are null, and eventually resave themselves overwriting the data in the database.
When I test using LONG RAW as a type it works perfectly, but LONG RAW is not a standard SQL type. I do not want to convert my beans to BMP, and also do not want to have any Oracle specific code in my beans to store retrieve my information. I need my beans to be completely database independant.
Does anyone have any ideas what could be causing my retrieval problem and what I could do to fix it?

I solved my problem.
I am using XDoclet to generate my bean interfaces and xml files etc., and it generates the jbosscmp-jdbc.xml file for me.
I forgot to add @jboss tags to my beans so that the jbosscmp-jdbc.xml file includes tags to overwrite the default cmp mapping (string to varchar) to be from string to clob for those specific long string fields that i want.

Similar Messages

  • Performance Issue: Retrieving records from Oracle Database

    While retrieving data from Oracle database we are facing performance issues.
    The query is returning 890 records and while displaying it on the jsp page, the page is taking almost 18 minutes for displaying records.
    I have observed that cpu usage is 100% while processing the request.
    Could any one advise what are the methods at DB end or Java end we can think of to avoid such issues.
    Thanks
    R.

    passion_for_java wrote:
    Will it make any difference if I select columns instead of ls.*
    possibly, especially if there's a lot or data being returned.
    Less data over the wire means a faster response,
    You may also want to look at your database, is that outer join really needed? Does it perform? Are your indexes good?
    A bad index (or a missing one) can kill query performance (we've seen performance of queries drop from seconds to hours when indexes got corrupted).
    A missing index can cause full table scans, which of course kill performance if the table is large.

  • Retrieving record from oracle DB very slow..pls help

    Hi, i'm writing a VB code to retrieving records from Oracle DB Server version 8. I'm using VB Adodb to retrieve the records from various tables. Unfortunately one of the table are very slow to response, the table only contain around 204900 records. The SQL Statement to retrieve the records is a simple SQL Statement that contain WHERE clause only. Any issue that will make the retrieving time become slow? Is that a Indexing? Oracle Driver? Hardware Spec? Or any solution for me to improve the performance. Thanks!

    Well, there are a few things to consider...
    First, can you try executing your query via SQL*Plus? If there are database tuning problems, your query will be slow no matter where you run it.
    Second, are you retrieving significantly more rows in this query than in your other queries? It can take a significant amount of time to retrieve records to the client, even if it's quick to select them.
    Justin

  • Connectivity issues from Oracle to Sybase

    Friends.
    I have connectivity issue from Oracle 9.2.0.1 to Sybase 12.5 ASE .I am connecting through the database link in oracle to access the tables.
    The error message i am getting :
    select count(*) from TEST_TABLE@IND_TEST;
    ERROR at line 1:
    ORA-28500: connection from ORACLE to a non-Oracle system returned this message:
    523 80
    ORA-02063: preceding 2 lines from IND_TEST
    Please guide me how to solve this error message. is it version incompatible now?
    Thanks
    Rocky

    Hi,
    You are now making the connection to the Sybase database but there is a problem with the user and password used in the database link.
    Sybase is case sensitive for names so you need to surround the user/password in double quotes to make sure they are passed to Sybase in the correct case -
    create database link ind_test connect to "sybuser" identified by "sybpass" using 'tnsnames_ora_entry' ;
    where sybuser is the userid as created in Sybase with the password sybpass.
    If they were setup in Sybase in mixed case then it would be -
    create database link ind_test connect to "Sybuser" identified by "Sybpass" using 'tnsnames_ora_entry' ;
    Regards,
    Mike
    Edited by: mkirtley on Sep 27, 2011 12:55 PM

  • Retrieve data from oracle table, table name passed in runtime into JSP

    Hello All,
    I am new to JSP, i have a requirement,
    I need to retrieve data from oracle table, here table is passed at random. how to get the data displayed in JSP page.
    can any one help me in that
    thanks

    1) Learn SQL.
    2) Learn Java.
    3) Learn JDBC.
    4) Learn DAO.
    5) Learn HTTP.
    6) Learn HTML.
    7) Learn JSP/Servlet.
    8) Learn JSTL.
    9) Apply learned things and develop.
    Whenever you stucks, please come back and post the specific coding/technical problem here.

  • Sending email from Oracle through Lotus Domino Server

    Hi,
    I would like to know whether it is possible to send an email from Oracle through a Lotus Domino Server(acting as mail server). If yes, please provide me with the details.
    Thanks in advance

    Have a look at the database UTL_SMTP package

  • Best way to retrieve data from oracle?

    Hi,
    I have a few questions.
    1.)Can a rowtype or a table type returned from oracle database can be retrieved as a dataset or datareader?
    2.)Cursors generally slow down your db(Iam from microsoft sql server back ground). But we seem to be using ref cursors quite a lot here.The only way to return a result as far as i have seen in oracle is to use a ref cursor.Is there any other way?

    Hello,
    1.)Can a rowtype or a table type returned from oracle database can be retrieved as a dataset or datareader?
    I'm not sure how complex your "table types" are -- do you mean PL/SQL Associative Arrays (formerly knowns as "index-by" tables)?
    I believe that %rowtype is a PL/SQL'ism that does not work outside of PL/SQL.
    However, the 11g version of the provider introduced User Defined Types (UDTs) which may be helpful depending on your requirements, etc.
    2.)Cursors generally slow down your db(Iam from microsoft sql server back ground). But we seem to be using ref cursors quite a lot here.The only way to return a result as far as i have seen in oracle is to use a ref cursor.Is there any other way?
    Using a ref cursor is the way to return a result set from PL/SQL to a client. If you are not using PL/SQL then you would not use a ref cursor.
    The .NET Developer Center has good information:
    http://www.oracle.com/technology/tech/dotnet/index.html
    Regards,
    Mark

  • Using Java to Retrieve Images from Oracle

    OracleResultSet.getCustomDatum method is deprecated. I was using this method to retrieve an ORDImage from an Oracle 9i database. What are developers using instead of getCustomDatum to retrieve images from the database. Thanks for all help in this matter.

    Hi use getBinaryStream(java.lang.String) or getBinaryStream(int) of java.sql.ResultSet for retrieving images from database
    Hope it will be useful
    regards
    chandru

  • Retrieve data from oracle table

    hi,
    i have uploaded a piece of xml format data in oracle and successfully uploaded but when trying to retrieve data it reterieve 0 records. Oracle version is given below:
    Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - 64bit Production
    PL/SQL Release 11.2.0.1.0 - Production
    create table temp_loading_lob(
                                            xml_id varchar2(3),
                                            q_clob CLOB
    nologging
    create table temp_loading_xml
    nologging as
    select xml_id,xmltype( q_clob) q_xml
    from temp_loading_lob;
    XMl Data
    <?xml version="1.0" encoding="ISO-8859-1" ?>
    <Root xmlns="http://www.w3.org/2000/10/XMLSchema">
         <Accounts ApplicationVersion="7.2.1.6 (10-02-2012)" Database="Q" DateExported="20120813">
              <Account AccountID="QF8AA000">
                   <AccountName>124 On Brunswick Bed &amp; Breakfast</AccountName>
                   <Addresses>
                        <Address AddressID="aQF8AA000YMY">
                             <Description>Physical</Description>
                             <Address1>124 Brunswick Drive</Address1>
                             <Address2>Brunswick Park - RD 4</Address2>
                             <Address3></Address3>
                             <Suburb></Suburb>
                             <City>Rotorua</City>
                             <Postcode></Postcode>
                        </Address>
                        <Address AddressID="aQF8AA000WXX">
                             <Description>Postal</Description>
                             <Address1>PO Box 7365</Address1>
                             <Address2></Address2>
                             <Address3></Address3>
                             <Suburb>Te Ngae</Suburb>
                             <City>Rotorua</City>
                             <Postcode>3042</Postcode>
                        </Address>
                   </Addresses>
    </Accounts>
    </Account>
    </Root>
    Query used to reterive data
    select po.*
    from temp_loading_xml p,
         XMLTable('/Accounts/Account'
                   PASSING p.q_xml
                   COLUMNS
                      AccountID varchar2(20) PATH '@AccountID'
                      ,AccountName varchar2(20) PATH 'AccountName'                 
                                  )poi am trying to catch my error but unable to fix it. Any help will ge greatly appretiated. How can i close my thread?
    Best Regards,
    Zaid

    >
    <Root xmlns="http://www.w3.org/2000/10/XMLSchema">
         <Accounts ApplicationVersion="7.2.1.6 (10-02-2012)" Database="Q" DateExported="20120813">
              <Account AccountID="QF8AA000">
    </Accounts>
    </Account>
    </Root>
    >
    must be
    <Root xmlns="http://www.w3.org/2000/10/XMLSchema">
         <Accounts ApplicationVersion="7.2.1.6 (10-02-2012)" Database="Q" DateExported="20120813">
              <Account AccountID="QF8AA000">
    </Account>
    </Accounts>
    </Root>and add namespaces to xmltable
    32  select po.*
    33  from temp_loading_xml p,
    34       XMLTable(
    35       xmlnamespaces(default 'http://www.w3.org/2000/10/XMLSchema')
    36       ,'Root/Accounts/Account'
    37                 PASSING p.q_xml
    38                 COLUMNS
    39                    AccountID varchar2(20) PATH '@AccountID'
    40                    ,AccountName varchar2(20) PATH 'AccountName'
    41                                )po
    42  /
    ACCOUNTID            ACCOUNTNAME
    QF8AA000             124 On Brunswick Bed
    SQL>

  • Problem with retrieving data from Oracle 10g / PHP4.3 / Apache 1.3.27

    Hi,
    I re-open a new thread following the opened post 'Getting RPMs for php-oracle for PHP4.3 on RHEL 4.0 and issue with OCI8 '
    I could re-installed PHP4.3 and apache 1.3.27 from the normal tar package (./configure then make) - I had some issues with the RPMs packages before.
    I could connect successfully PHP4.3 to my Oracle 10g DB with no issues by using some of the (deprecated) functions contained in oracle.so library in command line mode by executing a simple PHP script ;-)
    But ...when I try to execute the same script (a simple log on to the DB) or the application throught my web browser there are some errors in the apache error_log file that crash the process:
    [Wed Jul 25 13:19:23 2007] [notice] child pid 25450 exit signal Segmentation fault (11)
    [Wed Jul 25 13:19:31 2007] [notice] child pid 25451 exit signal Segmentation fault (11)
    *** glibc detected *** realloc(): invalid size: 0x08338898 ***
    [Wed Jul 25 13:19:42 2007] [notice] child pid 25441 exit signal Aborted (6)
    *** glibc detected *** realloc(): invalid size: 0x08338898 ***
    [Wed Jul 25 13:54:52 2007] [notice] child pid 25508 exit signal Aborted (6)
    [Fri Jul 27 04:39:56 2007] [notice] child pid 20550 exit signal Segmentation fault (11)
    After some investigations it looks like this is due to the connection of Oracle 10G and php.
    I tried to recompile Apache as the following:
    # cd /usr/src/apache_1.3.xx
    # make clean
    # LIBS=-lpthread ./config.status
    # make
    # make install
    but the issue is the same ...
    How can I workaround that issue and fix it in order to connect to Oracle 10 G by using PHP4.3 / apache 1.3.27 ?
    I need to use the oracle.so library to avoid to re-rewrite all my application ...
    Any help much very appreciated !
    Cheers
    Dominique

    You are in unchartered territory. But check the common "gotcha" and
    make sure that all the Oracle environment variables are set in the
    shell that starts Apache. Load the script <?php phpinfo(); ?> in a
    browser and see that whatever variables you need are set in the
    Environment section. See the section "Oracle Environment Variables
    for Connections" in Underground PHP and Oracle Manual
    I suspect it would be beneficial to migrate the PHP code to oci8.
    Check table 16-1 in Underground PHP and Oracle Manual for the mapping
    between 'oracle' and 'oci8' functions.
    -- cj

  • Retrieving data from oracle database and displaying using servlets

    //DataRetrieving.class file
    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class DataRetrieving extends HttpServlet{
    public void doGet(HttpServletRequest request, HttpServletResponse response)throws
    ServletException, IOException{ 
    response.setContentType("text/html");
    PrintWriter out = response.getWriter();
    out.println("A program for connecting oracle database");
    try
    Class.forName("oracle.jdbc.driver.OracleDriver");
    Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORCL", "scott","tiger");
    Statement stmt = con.createStatement();
    ResultSet r = stmt.executeQuery ("SELECT ename,job,sal,comm,deptno FROM emp");
    while ( r.next() )
         String bar = r.getString("ename");
         String bar1 = r.getString("job");
         float bar2 = r.getInt("sal");
         float bar3 = r.getInt("comm");
         int bar4 = r.getInt("deptno");
         //out.println(r.getString(0)+" "+r.getString("ename"));
         out.println("hi");
         out.println(bar1);
    r.close();
    stmt.close();
    con.close();
    catch (Exception e)
    out.println("ERROR : " + e);
    //web.xml file
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!--<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd"> -->
    <web-app>
    <servlet>
    <servlet-name>Hello</servlet-name>
    <servlet-class>DataRetrieving</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Hello</servlet-name>
    <url-pattern>/DataRetrieval</url-pattern>
    </servlet-mapping>
    </web-app>
    while running the servlet , i am unable to retrieve the data
    The error message i am getting is
    A program for connecting oracle database
    ERROR : java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
    after running the servlet.
    what could be the problem?

    import java.io.*;
    import java.sql.*;
    import javax.servlet.*;
    import javax.servlet.http.*;
    public class myserv extends HttpServlet
    public void doGet(HttpServletRequest req,HttpServletResponse res)throws ServletException,IOException
    res.setContentType("text/html");
    PrintWriter pw=res.getwriter();
    pw.println("Connecting data base");
         try
         Class.forName("oracle.jdbc.driver.OracleDriver");
         Connection con=Drivermanager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl","scott","tiger");
         Stamtenet st=con.createStament();
         Resultset rs=con.executeQurey("select * from emp");
         while(rs.next())
         rs.getInt("empno")+" "+rs.getDouble("sal"));
         }catch(Exception e)
    }

  • Java.sql : Cannot retrieve records from Oracle 9i with JDK 1.5

    I think I'm doing everything right, but still the following code does not
    return any rows. I have the classpath set correctly and ojdbc14.jar in
    the path. I'm using jdk 1.5.     
    What am I missing? Any help greatly appreciated. Thanks!
         Connection conn = null;
         String serverName = "MySvr";
         String portNumber = "1521";
         String sid = "mySID";
         String myURL = "jdbc:oracle:thin:@" + serverName + ":" + portNumber + ":" + sid;
         logger.writeLog("URL: " + myURL);
         String username = "scott";
         String password = "tiger";
         String query = "select 'test' from dual";
         DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
         conn = DriverManager.getConnection(myURL, username, password);
         Statement stmt = conn.createStatement();
         rs = stmt.executeQuery(query);
         logger.writeLog("Cur Row : " + rs.getRow());
    -----> returns 0
         while (rs.next()) {
    ------> throws java.lang.NullPointerException
         }

    I think I'm doing everything right, but still the following code does not
    return any rows. JDBC didn't change from 1.4 to 1.5, so that's a red herring. It's you, not the JVM.
    I have the classpath set correctly Really? A system CLASSPATH environment variable? I'd say that's wrong. Better to use the -classpath option on javac.exe when you compile and java.exe when you run.
    and ojdbc14.jar in the path. You'd better mean CLASSPATH and not PATH. CLASSPATH is for the Java class loader; PATH is for the operating system. Don't get the two confused.
    I'm using jdk 1.5.     Irrelevant here.
    What am I missing? Any help greatly appreciated. Thanks!I think you're using ResultSet incorrectly, because it's never null.
    Try this:
    // I'd externalize this so you could change it on the fly.
    String driver = "oracle.jdbc.driver.OracleDriver";
    String url = "jdbc:oracle:thin:@MySvr:1521:mySID";
    // I hope you're not using the default username and password for real
    String username = "scott"; 
    String password = "tiger";
    logger.writeLog("URL: " + url);
    Connection conn = null;
    Statement stmt = null;
    ResultSet rs = null;
    try
        Class.forName(driver);
        conn = DriverManager.getConnection(url, username, password);
        String sql = "select 1 from dual";
        stmt = conn.createStatement();
        rs   = stmt.executeQuery(sql);
        int value;
        while (rs.next())
            value = rs.getInt(1);
    catch (SQLException e)
        e.printStackTrace();
    finally
        // I'd put all these in a utility class
        try { if (rs != null) rs.close(); } catch (SQLException e) { logger.writeLog("could not close result set"); }
        try { if (stmt != null) stmt.close(); } catch (SQLException e) { logger.writeLog("could not close statement"); }
        try { if (conn != null) conn.close(); } catch (SQLException e) { logger.writeLog("could not close connection"); }
    }Note: close your resources in a finally block. It's important, especially if you don't want to run out of Oracle cursors.
    %

  • Populating selectboxes in form by retrieving data from oracle table

    hi guys...im a student .......i was thinking if someone could help me out.
    i am woking on a project which is being built using JSP with EL.(jstl)
    My problem is.......i have 2 interdependent select boxes in my form,which are CATEGORY and SUB CATEGORY. I could populate the first select box dynamically by extracting the values from the database table CATEGORYDATATABLE as foll:
    <sql:query var="q1" sql="select distinct(type) from catgorydatatable"/>
    <select name=selectbox1>
    <c:forEach var="a" items="${q1.rows}">
    <option>${a.type}</option>
    </c:forEach>
    </select>
    but the problem poped up when i tried to populate the second select box which is the subcategory.
    ie for example
    **if i select category as STUDENT from the first select box the second one should get populated with a of all student names......
    **on selecting category as Employee in first select box i should get to see all employee names in second select box and these names are to be extracted from the table.
    i tried the following code but it isnt working:
    <sql:query var=q2 sql="select subtype from categorydatatable where type=${param.selectbox1}"/>
    <select name=selectbox2>
    <c:forEach var=b items="${q2.rows}"/>
    <option>${b.subtype}</option>
    </select>
    please do help me with this.....i'd be very thankful on recieving a sample code on this
    thank u....
    shireeesha

    >
    After installing the ODAC package, I can now see a list of new drivers., including:
    1) Oracle in OraClient11g_home1This one is the one you installed when you installed the Oracle client.
    2) Oracle in XEThis one was installed when you installed XE on the system.
    Which one should I chose? I would have expected a Oracle Client in XE. Is there another ODAC package for the Express edition? I could not find any.I'd use the first one, though I don't use XE so have no experience with it. They're probably the same or very similar clients in this case.
    When I get into the Oracle ODBC Driver Configuration, it asks me for:
    TNS Service Name
    However, the dropdown box appears empty. Could you provide me a pointer on how to continue with the TNS Service name?There is a bug with the 32 bit driver that makes the dropdown always empty. You can just type the name in.
    Of course, that means you need to know the name. XE may have set that up for you already. Go to where you installed XE and look for a tnsnames.ora file, typically in the \network\admin folder. If your local database is set up there, you can copy that file to the same place in the other Oracle client's installation folder (\network\admin), and then type in the TNS name (that's the name before all the stuff in brackets).
    If there isn't one already set up, you'll have to create it and for XE I honestly have no idea how to do that. My DBA does it for all our databases. :)

  • How to insert/display a Blob field(PDF) from Oracle 11g into CR XI version 11.5.12.1838

    Hello
       I   am using CR version 11.5.12.1838 and I  would like to display/insert  a BLOB field into a CR report and this BLOB field has a .PDF file in it.  Is there anyway this can be done?
    Your help would be appreciated
    Thank you
    alpha

    Hi Alpha
    Not as far as CR is concerned. Note that even adding a PDF as an OLE object to cr will result in only the 1st page being rendered.
    From what I gather in the discussion here, I don't believe CR is the utility that can be used in this case.
    - Ludek
    Senior Support Engineer AGS Product Support, Global Support Center Canada
    Follow me on Twitter

  • Retrieve image from oracle table to vb front end

    Hi
    I want to create a table in oracle and want to insert an image to the table using lobs and i am trying to get display of image in visual basic form
    please help me
    solution send on [email protected]
    thanx

    Hi Rajat,
    First of you, please post your technical questions at
    http://forums.oracle.com/forums/index.jsp?cat=18
    Now coming to your question, are you using java or pl/sql to insert the image into database.
    If it is using jave then you can check the 'LOB Datatype' sample for inserting an image into LOB column. It is present at
    http://otn.oracle.com/sample_code/tech/java/sqlj_jdbc/files/advanced/LOBSample/LOBSample.java.html
    Regards,
    Anupama

Maybe you are looking for

  • Firefox will not open unless I delete it and download again.

    Firefox is set as my default browser. Something has happened recently that caused this. I have both I.E. and Torch which both open fine. When I try to open Firefox, nothing happens. Pressing Ctrl,Alt,Del shows nothing in the "task" box. When I click

  • 'reset all settings' on iPhone4 breaks passcode options!

    Wow, really annoying bug! I setup my iPhone 4 from a backup of my 3GS, but I decided today to reset the setting after hearing that setting up from a backup isn't always the best idea and might affect battery life. I figured, why not? Wellll, everythi

  • Can't set 'Blank' on Second display

    I've found that I can't set the second display to be plain blank, it still shows images the same as if it was set to 'Alternate'. I can set it to Desktop, but I prefer it to be plain black at times and not be a distraction. Anybody else got this? (ye

  • PO output language

    Hi,    I have set up the language as EN for output type ERS in the condition records. And I see the same in the invoice too. But my output is in  German. What other factors can influence the language of the output? Thanks Aparna

  • How do I export an M4V file

    I need to export an M4V file for a website. or an OGV file Why don't I see either? I know ipod is M4V (DRM) but its just exporting as an MP4. Does anyone know how to do this in Premiere? Im on the latest cloud version. and have older desktop version