Thread:
 Null value should be checked in the returned clob 
 barryku   27 Aug 2004, 22:38 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: barryku (27 Aug 2004, 22:38) Replies: 0, Views: 37508
Subject: Null value should be checked in the returned clob
I was getting NullPointer exception with null clob, and the following 
is my fix,

<code>
   public Object nullSafeGet(ResultSet rs, String[] names, Object 
owner)
         throws HibernateException, SQLException {
      Clob clob = rs.getClob(names[0]);
      return (clob==null? null :clob.getSubString(1, (int) clob.length
()));
   }
</code>
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
© Copyright 2006, Red Hat Middleware, LLC. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc. [Privacy Policy]