Thread:
 This works both for reading or writing with Inform... 
 ivaylodd   16 May 2008, 04:48 
 Re: This works both for reading or writing with... 
 Surya Mithra   22 Sep 2008, 06:44 

Comment
Prev. thread 
 Next thread
 
Prev. posting 
 Next posting
From: Surya Mithra (22 Sep 2008, 06:44) Replies: 0, Views: 526
Subject: Re: This works both for reading or writing with Informi...
This class worked for me however I was facing a class cast exception 
when I used the nullSafeSet method with

st.setClob(index, Hibernate.createClob((String) value));

I had to modify it to the following

 public void nullSafeSet(PreparedStatement st, Object value, int index)
	        throws HibernateException, SQLException
	    {
	    	if (value != null) {
	             StringReader((String)value );
		  st.setString(index, (String)value);	
	    } else {

		  st.setNull(index, sqlTypes()[0]);
	    }

	    }

It works for me now
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]