The SSH framework, which prompts for information when inserting a picture into oracle11g.
The image is byte[] the Blob field in the corresponding database, the error reason is the Oracle version problem, different versions are processed differently.
Spring.xml Configuration
How to handle Oracle9:
<bean id= "NativeJdbcExtractor" class= "Org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor" Lazy-init= "true"/>
<bean id= "Oraclelobhandler" class= "Org.springframework.jdbc.support.lob.OracleLobHandler" lazy-init= "true" >
<property name= "NativeJdbcExtractor" >
<ref bean= "NativeJdbcExtractor"/>
</property>
</bean>
How to handle ORACLE11:
<bean id= "Oraclelobhandler" class= "Org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init= "true"/ >
Ibatis using:
<insert id= "Insertexcel" parameterclass= "Java.util.Map" >
INSERT INTO XZXK_SPSC_SQCLFJ
(Wordid, tepid, tepcategory, Buspkey, Wordname, Wordsize, Wordcontent, CreateDate, Createman, Wordnew, Wordremark, Fileextname)
Values
(#WORDID #, #TEPID #, #TEPCATEGORY #, #BUSPKEY #, #WORDNAME #, #WORDSIZE #, #WORDCONTENT, handler= org.springframework.orm.ibatis.support.blobbytearraytypehandler#, Sysdate, #CREATEMAN #, #WORDNEW #, # wordremark#, #FILEEXTNAME #)
</insert>
How BLOB fields are handled by different versions of Oracle