spring+hibernateÖд¦Àíoracle BLOB
1¡¢ÅäÖÃhibernate£º
1.1¡¢ÅäÖÃhibernateµÄ³Ö¾ÃÀàÎļþÖжÔÓ¦µÄ×Ö¶ÎΪbyte[]ÀàÐÍ
2.2¡¢ÅäÖÃhibernateµÄÀàÓ³ÉäÎļþÖжÔÓ¦µÄ×Ö¶ÎtypeΪ
org.springframework.orm.hibernate3.support.BlobByteArrayType
2¡¢ÅäÖÃspring£º
2.1¡¢ÅäÖÃnativeJdbcExtractor£¬ÈçÏ£º
<bean id="nativeJdbcExtractor"
class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor" />
2.2¡¢ÅäÖÃoracleLobHandler
<bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler" lazy-init="true">
<property name="nativeJdbcExtractor">
<ref bean="nativeJdbcExtractor" />
</property>
</bean>
2.3°ÑoracleLobHandler¼ÓÈësessionFactoryÖÐ:
<property name="lobHandler">
<ref bean="oracleLobHandler" />
</property>
3¡¢×ܽ᣺
ÕýÈ·ÅäÖÃÒÔÉÏÁ½Ìõ£¬¾Í¿ÉÒÔÏñ´¦ÀíÆÕͨµÄ¶ÔÏóÒ»Ñù´¦ÀíoracleµÄ´ó¶ÔÏ󡣶øÇÒ¿ÉÒÔ·½ÃæµÄ´ÓoracleÉÏÒÆÖ²µ½Ö§³Ö´ó¶ÔÏóµÄÆäËûÊý¾Ý¿âÉÏ£¬ÆÁ±ÎÁ˲»Í¬Êý¾Ý¿â´¦Àílob×ֶεIJî±ð£»
4¡¢À©Õ¹£º
4.1¡¢´¦Àíclob¶ÔÏóÒ²ºÜ·½±ã£¬ÔÚÅäÖÃhibernateʱ°Ñ¶ÔÓ¦µÄÀàµÄÊôÐÔ×Ö¶ÎÅäÖÃΪString£¬Ó³ÉäÎļþtypeÅäÖÃΪorg.springframework.orm.hibernate3.support.ClobStringType¾ÍÐÐÁË¡£
<property name="context" column="context" type="org.springframework.orm.hibernate.support.Cl
Ïà¹ØÎĵµ£º
¡¶1¡·DDLÓï¾ä(Êý¾Ý¶¨ÒåÓïÑÔ) Data Define Language
create
alter
drop
truncate ¿ªÍ·µÄÓï¾ä truncate table <±íÃû>
Ìصã:<1>½¨Á¢ºÍÐÞ¸ÄÊý¾Ý¶ÔÏó
&nb ......
×î½üÏîÄ¿½ø¶È±È½Ï»ºÂý£¬³õ²½Ñо¿ÁËÒ»ÏÂOracleµÄ´æ´¢¹ý³Ì£¬½«´úÂëÌù³öÀ´¡£
Ê×ÏÈÏÈÌù³öÀ´OracleµÄ·ÖÒ³·ÖÒ³´æ´¢¹ý³Ì´úÂë°É¡£
1.ÕâÊÇ°üµÄ´úÂë
create or replace package DB_Oper is
-- Author : LIUBING
-- Created : 2009-10-28 15:01:30
-- Purpose : ²âÊÔOracleµ ......
ÓкܶàÓ¦ÓÃÏîÄ¿, ¸ÕÆð²½µÄʱºòÓÃMYSQLÊý¾Ý¿â»ù±¾ÉÏÄÜʵÏÖ¸÷ÖÖ¹¦ÄÜÐèÇó£¬Ëæ×ÅÓ¦ÓÃÓû§µÄÔö¶à£¬Êý¾ÝÁ¿µÄÔö¼Ó£¬MYSQL½¥½¥µØ³öÏÖ²»¿°ÖظºµÄÇé¿ö£ºÁ¬½ÓºÜÂýÉõÖÁå´»ú£¬ÓÚÊǾÍÓаÑÊý¾Ý´ÓMYSQLǨµ½ORACLEµÄÐèÇó£¬Ó¦ÓóÌÐòÒ²ÒªÏàÓ¦×öһЩÐ޸ġ£±¾ÈË×ܽá³öÒÔϼ¸µã×¢ÒâÊÂÏϣÍû¶Ô´ó¼ÒÓÐËù°ïÖú¡£
1£® ×Ô¶¯Ôö³¤µÄÊý¾ ......
OracleÊý¾Ý¿âÓÐÈýÖÖ±ê×¼µÄ±¸·Ý·½·¨£¬ËüÃÇ·Ö±ðÊǵ¼³ö£¯µ¼È루EXP/IMP£©¡¢Èȱ¸·ÝºÍÀ䱸·Ý¡£µ¼³ö±¸¼þÊÇÒ»ÖÖÂß¼±¸·Ý£¬À䱸·ÝºÍÈȱ¸·ÝÊÇÎïÀí±¸·Ý¡£
Ò»¡¢ µ¼³ö£¯µ¼È루Export£¯Import£©
ÀûÓÃExport¿É½«Êý¾Ý´ÓÊý¾Ý¿âÖÐÌáÈ¡³öÀ´£¬ÀûÓÃImportÔò¿É½«ÌáÈ¡³öÀ´µÄÊý¾ÝËͻص½OracleÊý¾Ý¿âÖÐÈ¥¡£
£±¡¢ ¼òµ¥µ¼³öÊý¾Ý£¨Export£©ºÍµ¼ ......
Àý£º
create user his identified by his default tablespace users temporary tablespace temp;
grant connect,resource,dba to his;
create tablespace his
logging
datafile 'd:\oracle\product\10.2.0\oradata\zjxsh\his.ora' size 100M extent
management local segment space management auto;
exp his/ny@ny ......