ÍøÉϵÄһЩjavaÃæÊÔÌâÕûÀí
ÃæÊÔÖг£³öÏÖµÄÁ½¸öHibernateÃæÊÔÌâ¼°½â´ð
Hibernate, Java/J2EE
1.ÔÚÊý¾Ý¿âÖÐÌõ¼þ²éѯËٶȺÜÂýµÄʱºò,ÈçºÎÓÅ»¯?
1.½¨Ë÷Òý
2.¼õÉÙ±íÖ®¼äµÄ¹ØÁª
3.ÓÅ»¯sql£¬¾¡Á¿ÈÃsqlºÜ¿ì¶¨Î»Êý¾Ý£¬²»ÒªÈÃsql×öÈ«±í²éѯ£¬Ó¦¸Ã×ßË÷Òý,°ÑÊý¾ÝÁ¿´óµÄ±íÅÅÔÚÇ°Ãæ
4.¼ò»¯²éѯ×ֶΣ¬Ã»ÓõÄ×ֶβ»Òª£¬ÒѾ¶Ô·µ»Ø½á¹ûµÄ¿ØÖÆ£¬¾¡Á¿·µ»ØÉÙÁ¿Êý¾Ý
×Ô¼ºÈ¥¿´http://www.mianwww.com/html/2009/02/2721.html
һЩSpringºÍHibernateµÄÃæÊÔÌâ(¸½´ð°¸)
Hibernate, Java/J2EE, Spring
1¡¢ ¼òÊöÄã¶ÔIoC£¨Inversion of Control£©µÄÀí½â£¬ÃèÊöÒ»ÏÂSpringÖÐʵÏÖDI£¨Dependency Injection£©µÄ¼¸ÖÖ·½Ê½¡£
2¡¢ SpringµÄBeanÓжàÖÖ×÷ÓÃÓò£¬°üÀ¨£º
singleton¡¢prototype¡¢request¡¢session¡¢global session¡¢application¡¢×Ô¶¨Òå
3¡¢ ¼òµ¥ÃèÊöSpring frameworkÓëStrutsµÄ²»Í¬Ö®´¦£¬ÕûºÏSpringÓëStrutsÓÐÄÄЩ·½·¨£¬ÄÄÖÖ×îºÃ£¬ÎªÊ²Ã´£¿
4¡¢ HibernateÖеÄupdate()ºÍsaveOrUpdate()µÄÇø±ð
5¡¢ Spring¶Ô¶àÖÖORM¿ò¼ÜÌṩÁ˺ܺõÄÖ§³Ö£¬¼òµ¥ÃèÊöÔÚSpringÖÐʹÓÃHibernateµÄ·½·¨£¬²¢½áºÏÊÂÎñ¹ÜÀí¡£
´ð°¸£º
1¡¢ºÃÀ³ÎëÔÔò€€€€²»Òª´òµç»°ÕÒÎÒ£¬ÎÒ»á´ò¸øÄãµÄ¡£IoC½«´´½¨µÄÖ°Ôð´ÓÓ¦ÓóÌÐò´úÂë°áµ½ÁË¿ò¼ÜÖС£Spring¶ÔSetter×¢ÈëºÍ¹¹Ôì·½·¨×¢ÈëÌṩ֧³Ö¡££¨Ïê¼ûhttp://martinfowler.com/articles/injection.html£¬ÒÔ¼°http: //www.redsaga.com/spring_ref/2.0/html/beans.html#beans-factory- collaborators£©
2¡¢ ³ýapplication£¨Ïê¼ûSpring framework 2.0 ReferenceµÄ3.4½ÚbeanµÄ×÷ÓÃÓò£©
3¡¢ SpringÊÇÍêÕûµÄһվʽ¿ò¼Ü£¬¶øStruts½öÊÇMVC¿ò¼Ü£¬ÇÒ×ÅÖØÓÚMVCÖеÄC¡£SpringÓÐÈýÖÖ·½Ê½ÕûºÏStruts£ºÊ¹Óà Spring µÄ ActionSupport ÀàÕûºÏ Struts£»Ê¹Óà Spring µÄ DelegatingRequestProcessor ¸²¸Ç Struts µÄ RequestProcessor£»½« Struts Action ¹ÜÀíίÍиø Spring ¿ò¼Ü£¬¶¯×÷ίÍÐ×îºÃ¡££¨Ïê¼ûʹÓÃSpring ¸üºÃµØ´¦ÀíStruts ¶¯×÷£©
Spring 2.0ÐÂÔöÒ»ÖÖ·½Ê½£ºAutowiringRequestProcessor¡££¨Ïê¼ûhttp://www.javaeye.com/topic/24239£©
4¡¢ saveOrUpdate()·½·¨¿ÉÒÔʵÏÖupdate()µÄ¹¦ÄÜ£¬µ«»á¶àЩ²½Ö裬¾ßÌåÈçÏ£º
Èç¹û¶ÔÏóÔÚ¸ÃsessionÖÐÒѾ±»³Ö¾Ã»¯£¬²»½øÐвÙ×÷£»
¶ÔÏóµÄ±êʶ·ûÊôÐÔ(identifier property)ÔÚÊý¾Ý¿âÖв»´æÔÚ»òÕßÊǸöÔÝʱµÄÖµ£¬µ÷ÓÃsave()·½·¨±£´æËü£»
Èç¹ûsessionÖеÄÁíÒ»¸ö¶ÔÏóÓÐÏàͬµÄ±êʶ·ûÅ׳öÒ»¸öÒì³££»
ÒÔÉϽԲ»·ûºÏÔòµ÷ÓÃupdate()¸üÐÂÖ®¡£
5¡
Ïà¹ØÎĵµ£º
Ŀ¼
Éú³ÉÏ̵߳ÄÁ½ÖÖ·½·¨
Ï̵߳ÄÖжÏ
Ïß³Ì״̬
Ïß³ÌÊôÐÔ
ͬ²½
×èÈû¶ÓÁÐ
Ḭ̈߳²È«¼¯ºÏ
callable,Future
Ö´ÐÐÆ÷
ͬ²½Æ÷
Ï̺߳ÍSwing
Éú³ÉÏ̵߳ÄÁ½ÖÖ·½·¨
ʵÏÖRunnable,²¢×÷Ϊ²ÎÊý´«¸øThread
public class ThreadGenerieren {
public static void main(String[] args) {
RunnableExsamp ......
µ±È»£¬Ê×ÏÈÒª°²×°ÓÐJDK(Ò»°ãÊÇJDK1.5.X)¡£È»ºó°²×°MySQL£¬ÕâЩ¶¼±È½Ï¼òµ¥£¬¾ßÌå¹ý³Ì¾Í²»ËµÁË¡£ÅäÖúÃÕâÁ½¸ö
»·¾³ºó£¬ÏÂÔØJDBCÇý¶¯mysql-connector-java-5.1.5.zip£¨http://www.ntu-w.lkams.kernel.org/pub/MySQL/Downloads/Connector-J/mysql-connector-java-5.1.5.zip£©¡£È»ºó½«Æä½âѹËõµ½ÈÎһĿ¼¡£ÎÒÊǽâѹµ½DÅÌ£¬È»ºó½ ......
²ÉÓÃUDPµÄͨѶ·½Ê½£¬µ÷ÓÃjava×Ô´øµÄawt´òÓ¡½Ó¿Ú
·þÎñÆ÷¶Ë´úÂë
Server£º
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.SocketException;
public class Server
{
private DatagramSocket server;
private DatagramPacket packet;
......
ÔÚJSPÀ»ñÈ¡¿Í»§¶ËµÄIPµØÖ·µÄ·½·¨ÊÇ£ºrequest.getRemoteAddr£¨£©£¬ÕâÖÖ·½·¨Ôڴ󲿷ÖÇé¿ö϶¼ÊÇÓÐЧµÄ¡£µ«ÊÇÔÚͨ¹ýÁËApache£¬SquidµÈ·´Ïò´úÀíÈí¼þ¾Í²»ÄÜ»ñÈ¡µ½¿Í»§¶ËµÄÕæʵIPµØÖ·ÁË¡£
Èç¹ûʹÓÃÁË·´Ïò´úÀíÈí¼þ£¬½«http://192.168.1.110£º2046/ µÄURL·´Ïò´úÀíΪ
http://www.bt285.cn /
µÄURLʱ£¬ÓÃreques ......
Java 2 C++ http://www.javaeye.com/topic/295776
1. ½â¾öÐÔÄÜÎÊÌâ
Java¾ßÓÐƽ̨ÎÞ¹ØÐÔ£¬ÕâʹÈËÃÇÔÚ¿ª·¢ÆóÒµ¼¶Ó¦ÓõÄʱºò×ÜÊÇ°ÑËü×÷ΪÖ÷ÒªºòÑ¡·½°¸Ö®Ò»£¬µ«ÊÇÐÔÄÜ·½ÃæµÄÒòËØÓÖ´ó´óÏ÷ÈõÁËËüµÄ¾ºÕùÁ¦¡£Îª´Ë£¬Ìá¸ßJavaµÄÐÔÄܾÍÏÔµÃÊ®·ÖÖØÒª¡£Sun¹«Ë¾¼°JavaµÄÖ§³ÖÕßÃÇΪÌá¸ßJavaµÄÔËÐÐËÙ¶ÈÒѾ×ö³öÁËÐí¶àŬÁ¦£¬ÆäÖдó¶àÊý¼¯ÖÐ ......