Hi all,

before and after having post my question, I dig a lot in the forums but did not find 
any real solution that match my situation.

About the problem of CLOB value retrieval, I found that some people had the same 
problem and solve it specifying some special type-mapping in the configuration.
OK, but I try but failed to set the correct settings playing with the XDoclet tags and 
the "standardjbosscmp-jdbc.xml".

Can someone give me hint about this ?


The second point is that I read very often that the CLOB can only work with the OCI 
drivers to Oracle. I must admit that I am very disappointed for this argument since we 
work only with the thin driver and no problem dealing (in BMP) with clobs. 
Here you can find some code that we use (this code is slightly modified to be 
understood in a mail):
    public void insert( LogData logData )
  |       throws PrimaryKeyCreateException, SQLException, LogDataInsertFKLogException {
  |         if( logData.getId(  ) == null ) {
  |             logData.setId( ... );
  |         }
  | 
  |         StringBuffer sql = new StringBuffer( "INSERT INTO " ).append( 
TableLogData.TABLE_NAME ).append( " ( " );
  |         sql.append( TableLogData.ID ).append( ", " );
  |         sql.append( TableLogData.DATA ).append( ", " );
  |         sql.append( TableLogData.TYPE );
  |         sql.append( " ) VALUES ( ?, ?, ?)" );
  | 
  |         PreparedStatement psStmt = this.getConnection(  ).prepareStatement( 
sql.toString(  ) );
  |         try {
  |             psStmt.setLong( 1, logData.getId(  ).longValue(  ) );
  |             psStmt.setClob( 2, oracle.sql.CLOB.empty_lob(  ) );
  |             psStmt.setString( 3, logData.getType(  ) );
  |             if( psStmt.executeUpdate(  ) <= 0 ) {
  |                 throw new SQLException( "Company could not be inserted!" );
  |             }
  |             try {
  |                 Statement sqlStatement = getConnection(  ).createStatement(  );
  |                 try {
  |                     StringBuffer query = new StringBuffer("SELECT ");
  |                     query.append( TableLogData.DATA );
  |                     query.append( " FROM " ).append( TableLogData.TABLE_NAME );
  |                     query.append( " WHERE " );
  |                     query.append( TableLogData.ID ).append( "=" ).append( 
logData.getId(  ).toString(  ) );
  |                     ResultSet result = sqlStatement.executeQuery( query.toString(  
) );
  |         
  |                     try {
  |                         if( result.next(  ) ) {
  |                             CLOB clob = ( CLOB ) result.getClob( 1 );
  |                             try {
  |                                 if( clob != null ) {
  |                                     Writer writer = clob.getCharacterOutputStream( 
 );
  |                                     if( logData.getData(  ) == null ) {
  |                                         writer.write( "" );
  |                                     } else {
  |                                         writer.write( logData.getData(  ) );
  |                                     }
  |                                     writer.close(  );
  |                                 }
  |                             } catch( IOException ioe ) {
  |                                 ...
  |                             }
  |                         }
  |                     } finally {
  |                         result.close(  );
  |                     }
  |                 } finally {
  |                     sqlStatement.close(  );
  |                 }
  |             } catch( SQLException sqle ) {
  |                 ...
  |             }
  |         } catch( SQLException sqle ) {
  |             ...
  |         } finally {
  |             psStmt.close(  );
  |         }
  |     }
  | 

So, if the "OCI solution" is the only one, is this a bug or a possible improvement of 
JBoss?
I work with the 3.0.8 version, is there corrections of this situation in the 3.2.x 
versions or in the Jboss 4 future version?

Thanks by advance for any feedback,
Alban.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3832078#3832078

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3832078


-------------------------------------------------------
This SF.net email is sponsored by: The Robotic Monkeys at ThinkGeek
For a limited time only, get FREE Ground shipping on all orders of $35
or more. Hurry up and shop folks, this offer expires April 30th!
http://www.thinkgeek.com/freeshipping/?cpg=12297
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to