4 Replies Latest reply on Jan 2, 2002 3:40 PM by dsundstrom

    Handling CLOB in JBoss/Oracle environment

    subuv1

      I was wondering how others are storing character strings larger than 4000 characters in a jboss/Oracle environment. I get exceptions when trying to store it as a clob (I made changes to jaws.xml for type mapping)

        • 1. Re: Handling CLOB in JBoss/Oracle environment
          juergenheidak

          I have this problem too.

          As a simple (but ugly) workaround we split the string to be stored into portions smaller than 4000 chars and save each part alone.

          If you find a better solution please let me know :-).

          • 2. Re: Handling CLOB in JBoss/Oracle environment
            robspychala

            If you're doing BMP then you can directly use JDBC.

            clob = (java.sql.Clob) clobSqlObj;

            String strClob = clob.getSubString((long) 1,(int) ((java.sql.Clob) clobSqlObj).length());

            r.S.

            • 3. Re: Handling CLOB in JBoss/Oracle environment
              subuv1

              Thanks for your response. We are using CMP and our application is targeted towards several app servers (jboss, Silverstream, etc) and we are trying to keep the same codebase for all. I have seen a response elsewhere where they use a combination of CMP and BMP.
              http://www.kpi.com.au/jbossarchive/0012/0028.html

              Is there a better way to do it ? I thought storing strings larger than 4000 characters should be pretty routine ...

              > If you're doing BMP then you can directly use JDBC.
              >
              > clob = (java.sql.Clob) clobSqlObj;
              >
              > String strClob = clob.getSubString((long) 1,(int)
              > ((java.sql.Clob) clobSqlObj).length());
              >
              > r.S.

              • 4. Re: Handling CLOB in JBoss/Oracle environment
                dsundstrom

                You should be able to use CLOB with both JAWS and JBossCMP. I haven't personally tried it out, but all you should have to do is change the jdbc-type element of your column to CLOB. For more information, see the section titled "Telling JAWS about your tables" in Chapter 6: "Customizing JAWS" of the free manual

                If you find a bug in this code, please post a bug report at sourceforge.