Hi,

I am hoping someone can help me. I am using jboss 2.4.4 and oracle 8i to
store a CLOB field in an entity bean. When it comes to storing the beans
data i would like to get a reference to the LOB to write into it. I have
written a piece of code shown below in which i believe i should be able
to obtain the reference. Unfortunately i get a null back. When i do get
the result set back i grab its meta data which shows that there is a
column called model which is of Oracle type 2005( clob presumably ). As
you can see i have some debug code in there and i have placed that at
the bottom the mail.

I have a CLOB in the database and i have double checked that a good few
times. i have also changed the mapping in standardjaws

            <mapping>
                <java-type>java.lang.Object</java-type>
                <jdbc-type>JAVA_OBJECT</jdbc-type>
                <sql-type>CLOB</sql-type>
            </mapping>

Any help or advice into why this does not seem to work for me would be
greatly recieved.


///////////////////////////////////////////////////////////
code
///////////////////////////////////////////////////////////

        // oracle CLOB
        CLOB modelClob = null;
        ResultSet rs = null ;
        
        try{    
            sl.info( " - query: " + query ) ;
            PreparedStatement ps = conn.prepareStatement( query ) ;
            rs = (ResultSetInPool)ps.executeQuery();
                        
            // debug out 
            java.sql.ResultSetMetaData rsm = rs.getMetaData() ;
            for( int i = 1 ; i <= rsm.getColumnCount() ; i++  ){
                sl.info( " - column name: " + rsm.getColumnName( i )  )
;
                sl.info( " - column type: " + rsm.getColumnType( i )  )
;
            }
              
            while( rs.next() ){

                modelClob = ( CLOB ) rs.getClob( "MODEL" ) ;

                sl.info( " - we get: " +  modelClob ) ;
                
                if ( ( modelClob != null ) && ( clobAsString != null) ){
                    this.writeTextToCLOB( clobAsString , modelClob ) ;
                }            
            }
       }
       ...............

///////////////////////////////////////////////////////////
debug
///////////////////////////////////////////////////////////

[INFO,Default] BlueSky:  - query: SELECT model FROM ORDERS where id =
6944 for update
[INFO,Default] BlueSky:  - column name: MODEL
[INFO,Default] BlueSky:  - column type: 2005
[INFO,Default] BlueSky:  - we get: null

Many thanks

David Rocks
Technical Lead
Elevation Networks
www.elevation-networks.com



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to