ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Rodenbaugh" <drodenba...@WILDBLUECORP.COM>
Subject RE: resultClass for BLOB field
Date Mon, 18 Dec 2006 17:03:11 GMT
Did you try java.lang.Byte[]?  I doubt byte[] is a referenceable alias
like "int" or "map".  resultClass is looking for a package-qualified
classname, in general.


From: Karen Koch [mailto:kmkoch@sbcglobal.net] 
Sent: Monday, December 18, 2006 10:00 AM
To: Clinton Begin; user-java@ibatis.apache.org
Subject: Re: resultClass for BLOB field

Re: your comments, Clinton, the field is not huge, and I just want to
grab a stored encrypted password in order to decrypt it and compare to
the user-entered password (part of a login procedure).

Now, my latest problem: substituting "byte[]" in for the resultClass
yields a java.lang.ClassNotFoundException exception for byte[].  (I
forgot to mention having already attempted that.)

<select id="getEncryptedPassword" resultClass="byte[]"
        SELECT Password FROM EPLoginAccount WHERE EmailAddr = #value#

Perhaps I'm not familiar with how to return an array from a statement.
A bit of help?

Thanks again,

Clinton Begin <clinton.begin@gmail.com> wrote: 

	Right.  We don't make use of the JDBC Blob/Clob classes.  So you
have to use a byte[] (byte array).
	However, if your BLOB is huge, you might want to stream it
directly to disk, or even directly to the browser.  In this case you'll
want to bypass iBATIS, as it likely doesn't make sense to map huge data
structures to anything resident in memory. 
	On 12/18/06, Karen Koch <kmkoch@sbcglobal.net> wrote: 

		Hello --
		I think this is a simple one:  What is the proper
resultClass to use when returning only a single column (of BLOB type) as
the result of a statement?  SqlMaps doesn't seem to like "BLOB".
		 <select id="getEncryptedPassword" resultClass=???
		        SELECT Password FROM EPLoginAccount WHERE
EmailAddr = #value#
		Karen Koch

View raw message