Ò»¸ö¼òµ¥µÄhibernateÁ¬½ÓoracleÊý¾Ý¿âÀý×Ó£¡
Ò»¡¢ Hibernate½éÉÜ
HibernateÊÇ»ùÓÚ¶ÔÏó/¹ØϵӳÉ䣨ORM£¬Object/Relational Mapping£©µÄÒ»¸ö½â¾ö·½°¸¡£ORM·½°¸µÄ˼ÏëÊǽ«¶ÔÏóÄ£ÐͱíʾµÄ¶ÔÏóÓ³Éäµ½¹ØϵÐÍÊý¾Ý¿âÖУ¬»òÕß·´Ö®¡£HibernateÄ¿Ç°ÊÇORM˼ÏëÔÚJavaÖÐ×î³É¹¦¡¢×îÇ¿´óµÄʵÏÖ¡£ËüÓÚ2001ÄêµÄÄêÄ©·¢²¼µÚÒ»¸ö°æ±¾£¬Á¢¼´ÒýÆðÁ˹㷺µÄ×¢Òâ¡£2003Äê6Ô£¬Hibernate2·¢±í£¬²¢ÇÒ»ñµÃJolt´ó½±£¬½ø¶ø±»JBossÎüÄɳÉΪËüµÄÒ»¸ö×ÓÏîÄ¿¡£2005Äê3Ô£¬Hibernate 3·¢±í£¬ÆäÖÐ×öÁËһЩ±È½ÏÖØ´óµÄ¸Ä½ø¡£±¾ÎÄÒÔHibernate3Ϊ»ù´¡±àд¡£
ÁíÍ⣬Hibernate³ýÁË¿ÉÒÔÔÚJ2EEÈÝÆ÷ÖÐÔËÐÐÍ⣬»¹¿ÉÒÔÔËÐÐÔÚJavaÓ¦ÓóÌÐòÖС£±¾ÎľÍÊÇÒÔJavaÓ¦ÓóÌÐòΪÀýÀ´½éÉÜËü¡£
¶þ¡¢ÅäÖÿª·¢»·¾³
±¾ÎÄÒÔÒ»¸öJavaÓ¦ÓóÌÐò£¨Java Application£©ÎªÀý£¬½éÉÜÈçºÎʹÓÃHibernateÀ´½øÐÐÊý¾Ý¿â²Ù×÷¡£
ÔÚ½øÐÐHibernate¿ª·¢Ö®Ç°£¬ÐèÒªÊ×ÏÈ»ñµÃHibernateÀà¿â¡¢ÏàÓ¦Êý¾Ý¿âµÄJDBCÇý¶¯Àà¿â¡£HibernateÀà¿â¿ÉÒÔ´Óhttp://www.hibernate.orgÖÐÏÂÔØ£¬Ä¿Ç°µÄ°æ±¾ÊÇ3.0¡£¶øJDBCÇý¶¯¿ÉÒÔ¸ù¾Ý²»Í¬µÄÊý¾Ý¿âÀ´Ñ¡Ôñ£¬ÔÚÕâ¸öÀý×ÓÖУ¬Ê¹ÓõÄÊÇOracleÊý¾Ý¿â£¬ÄÇôÏàÓ¦µÄJDBCÇý¶¯¿ÉÒÔ´ÓOracle°²×°Ä¿Â¼\ora92\jdbcÏ»ñµÃ¡£ÆäËûµÄÊý¾Ý¿âÇë¸ù¾ÝÏà¹ØµÄ˵Ã÷»ñµÃ¡£
ÏÂÔØHibernate°üºó£¬¿ÉÒÔ½«Ëü½âѹµ½Ò»¸öÎļþ¼Ð£¬´Ë´¦¼ÙÉèΪC:\hibernate-3.0£¬È»ºó½«C:\hibernate-3.0\ϵÄhibernate.jarºÍC:\hibernate-3.0\libϵÄÄÇЩµÚÈý·½Àà¿âÒ²·Åµ½»·¾³±äÁ¿CLASSPATHÖС££¨Í¨³££¬Ö»ÐèÒªdom4j¡¢cglig¡¢commons-logging¡¢commons-collections¡¢log4j¡¢ehcache¡¢asm¡¢jta¡¢antlrÕâЩÀà¿â¾Í¿ÉÒÔÁË£©
×öÍêÕâЩÅäÖú󣬾ͿÉÒÔÔÚ´Ë»ù´¡ÉϽøÐлùÓÚHibernateµÄJava³ÌÐò¿ª·¢ÁË¡£
Èý¡¢¿ª·¢»ùÓÚHibernateµÄÓ¦ÓÃ
ÏÖÔÚ¼ÙÉèÎÒÃÇÔÚOracleÊý¾Ý¿âÖд´½¨ÁËÒ»¸ö±íStudent£¬ËüµÄ×Ö¶ÎÈçϱíËùʾ£º
×ֶΠ˵Ã÷
Student_ID ѧԱ±àºÅ£¬ÕûÐÍ£¬PK£¬×Ô¶¯Ôö³¤
Student_Name ѧԱÐÕÃû£¬×Ö·û´®ÀàÐÍ
Student_Age ѧԱÄêÁ䣬ÕûÐÍ
Èç¹ûÎÒÃÇÔÚOracleÖж¨ÒåÕâ¸öÊý¾Ý¿â±í£¬ÎÒÃÇ¿ÉÒÔ¶¨ÒåÒ»¸ö´´½¨Êý¾Ý¿â±íµÄSQL½Å±¾ÈçÏ£º
create table Student(
Student_ID number(6) NOT NULL PRIMARY KEY,
Student_Name varchar2(10) NOT NULL,
Student_Age number(2) NOT NULL
);
ÁíÍ⣬ÒòΪÔÚOracleÖÐûÓГ×Ô¶¯Ôö³¤”ÀàÐ͵Ä×Ö¶Î
Ïà¹ØÎĵµ£º
ijÊý¾Ý¿âÖеÄÒ»ÕűíA,±íAµÄÊý¾Ý¿âÁ¿ÏÖÔÚ´ó¸ÅÓÐ10ÒÚÌõÊý¾ÝÖ®¶à.
×î³õµÄ×ö·¨ÊÇÈ«²¿´æ·ÅÔÚÒ»¸ö±í¿Õ¼äÖÐ.Ôì³ÉÏÖÔڵIJéѯËٶȹêÅÀËƵÄ.ÏÖÔÚ²»µÃ²»¶ÔÊý¾Ý¿â×ö³öÖØÐÂÆÀ¹ÀºÍÓÅ»¯.
×î³õµÄÇ°Ìá:
1.ÖÐÓ¦¸Ã½¨Á¢µÄË÷Òý¶¼ÒѾ߱¸
2.²éѯÓï¾ä¶¼ÒѾ×öµ½ÓÅ»¯:ÏÖÔÚÀàËÆÓÚ select count(1) from A Õâô¼òµ¥µÄÒ»¾äͳ¼ÆSQL¶¼ÐèÒª100S×óÓÒ
ta ......
oracle8i Çý¶¯ ojdbc14.jar Õâ¸öÇý¶¯ÓÐÎÊÌ⣬·ÖҳʱҪÊÖ¶¯ д rownum<m ,Ëü×Ô¶¯³ÉÉúµÄ·ÖÒ³²»ÕýÈ·£¬ÓõÄmysqlµÄtop m
Null value was assigned to a property of primitive °ÑentityÖÐintÀàÐ͸ijÉInteger ¿âÖв»ÉèÖÃnullable
number(9) µÄid ²»ÄÜÓÃInterger,µÃÓÃBigDecimal,Òª²»È»È¡idʱ»á±¨´í ......
OracleÆô¶¯Ê±ÐèÒªµÄ·þÎñ£º
ÔÌûµØÖ·£ºhttp://www.blogjava.net/sidanzhou/archive/2008/03/03/183507.html
×¢£ºSID - Êý¾Ý¿â±êʶ
HOME_NAME - Oracle HomeÃû³Æ£¬ÈçOraHome92¡¢OraHome81
£¨1£©OracleServiceSID
Êý¾Ý¿â·þÎñ£¬Õâ¸ö·þÎñ»á×Ô¶¯µØÆô¶¯ºÍÍ£Ö¹Êý¾Ý¿â¡£Èç¹û°²×°ÁËÒ»¸öÊý¾Ý¿â£¬ËüµÄȱʡÆô¶¯ÀàÐÍΪ×Ô¶¯¡£·þÎñ½ø³ ......
insert into dts_auction_comments (id,auction_id,user_id,user_nick,comments,gmt_create,gmt_modified,status,comm_type)
values(409,127380, ......
רÓ÷þÎñÆ÷£ºÒ»¸ö¿Í»§¶ËÁ¬½Ó¶ÔÓ¦Ò»¸ö·þÎñÆ÷½ø³Ì
¹²Ïí·þÎñÆ÷£º¶à¸ö¿Í»§¶ËÁ¬½Ó¶ÔÓ¦Ò»¸ö·þÎñÆ÷½ø³Ì£¬·þÎñÆ÷¶Ë´æÔÚÒ»¸ö½ø³Ìµ÷¶ÈÆ÷À´¹ÜÀí¡£
OracleȱʡÓõÄÊÇרÓ÷þÎñÆ÷ģʽ£¬Oracle¿ÉÒÔͬʱ֧³Ö¹²Ïí·þÎñÆ÷ºÍרÓ÷þÎñÆ÷ģʽ£¬¿ÉÒÔÖ¸¶¨Ò»¸ö»á»°Ê¹ÓÃרÓ÷þÎñÆ÷£¬ÁíÒ»¸ö»á»°Ê¹Óù²Ïí·þÎñÆ÷¡£
¹²Ïí·þÎñÆ÷¾ßÓÐÒÔÏÂһЩȱµã£º
1)¹² ......