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
Ïà¹ØÎĵµ£º
Ò»¡¢PL/SQL³öÏÖµÄÄ¿µÄ
¡¡¡¡½á¹¹»¯²éѯÓïÑÔ(Structured Query
Language£¬¼ò³ÆSQL)ÊÇÓÃÀ´·ÃÎʹØϵÐÍÊý¾Ý¿âÒ»ÖÖͨÓÃÓïÑÔ£¬ËüÊôÓÚµÚËÄ´úÓïÑÔ£¨4GL£©£¬ÆäÖ´ÐÐÌصãÊǷǹý³Ì»¯£¬¼´²»ÓÃÖ¸Ã÷Ö´ÐеľßÌå·½·¨ºÍ;
¾¶£¬¶øÊǼòµ¥µÄµ÷ÓÃÏàÓ¦Óï¾äÀ´Ö±½ÓÈ¡µÃ½á¹û¼´¿É¡£ÏÔÈ»£¬ÕâÖÖ²»¹Ø×¢ÈκÎʵÏÖϸ½ÚµÄÓïÑÔ¶ÔÓÚ¿ª·¢ÕßÀ´ËµÓÐ׿«´óµÄ ......
˵µ½Èí½âÎö£¨soft prase£©ºÍÓ²½âÎö£¨hard prase£©£¬¾Í²»Äܲ»ËµÒ»ÏÂOracle¶ÔsqlµÄ´¦Àí¹ý³Ì¡£µ±Äã·¢³öÒ»ÌõsqlÓï¾ä½»¸¶Oracle£¬ÔÚÖ´ÐкͻñÈ¡½á¹ûÇ°£¬Oracle¶Ô´Ësql½«½øÐм¸¸ö²½ÖèµÄ´¦Àí¹ý³Ì£º
1¡¢Óï·¨¼ì²é£¨syntax check£©
¼ì²é´ËsqlµÄƴдÊÇ·ñÓï ......
OracleÊý¾Ý¿âÓÐÈýÖÖ±ê×¼µÄ±¸·Ý·½·¨£¬ËüÃÇ·Ö±ðÊǵ¼³ö£¯µ¼È루EXP/IMP£©¡¢Èȱ¸·ÝºÍÀ䱸·Ý¡£µ¼³ö±¸¼þÊÇÒ»ÖÖÂß¼±¸·Ý£¬À䱸·ÝºÍÈȱ¸·ÝÊÇÎïÀí±¸·Ý¡£
Ò»¡¢ µ¼³ö£¯µ¼È루Export£¯Import£©
ÀûÓÃExport¿É½«Êý¾Ý´ÓÊý¾Ý¿âÖÐÌáÈ¡³öÀ´£¬ÀûÓÃImportÔò¿É½«ÌáÈ¡³öÀ´µÄÊý¾ÝËͻص½OracleÊý¾Ý¿âÖÐÈ¥¡£
£±¡¢ ¼òµ¥µ¼³öÊý¾Ý£¨Export£©ºÍµ¼ ......
Ò»¡£Oracle·þÎñÆ÷µÄ³£ÓÃÃüÁîÐÐÏêϸ½²½â
1.Êý¾Ý¿â¹ÜÀíÏà¹Ø
¡¡¡¡bbed.exe¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Êý¾Ý¿éä¯ÀÀºÍ±à¼¹¤¾ß
¡¡¡¡dbv.exe¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Êý¾ÝÎļþÂß¼¼ì²â¹¤¾ß
¡¡¡¡exp.exe¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Êý¾Ýµ¼³ö¹¤¾ß
¡¡¡¡imp.exe¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Êý¾Ýµ¼È빤¾ß
¡¡¡¡mig.exe¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Êý¾Ý¿âÒÆÖ²¹¤¾ß
¡¡¡ ......
1¡¢´´½¨ÐòÁÐÓï·¨£º(ÐèÒªCREATE SEQUENCEϵͳȨÏÞ)
CREATE SEQUENCE ÐòÁÐÃû
[INCREMENT BY n] ---ÓÃÓÚ¶¨ÒåÐòÁеIJ½³¤¡£
......