java.util.Properties是一个类,它有getProperty和setProperty等方法,通常用于哈希表Hashtable,通过键值(Key)直接访问javax.naming.Context 是上下文环境,可以理解为初始化时必须的环境,有了这个环境你才能使用连接池ctx.lookup 很显然,lookup(寻找的意思),通过JNDI去找到对应的连接池

解决方案 »

  1.   

    youthy_yy(希望我的回帖能对您有所帮助)的回复确实简明扼要,而且说的不错,感觉有了一些认识,不过parms这个变量,它从开始到结束扮演了一个什么样的角色?麻烦你再解释解释,嘿嘿,50分就给你了,你就好人好到底吧!
      

  2.   

    java.util.Properties parms ,你可以把parms理解为文本文件指针,通过这个文件指针读取你在.xml文件的配置(resin里是resin.conf文件)另外下面这句话要改一下,不然新手容易理解错误:
    javax.naming.Context 是上下文环境,可以理解为初始化时必须的环境,有了这个环境你才能使用连接池                       《-------------末尾改成:“有了这个环境你才能查找到连接池配置”
      

  3.   

    谢谢诸位,^_^, daimin78(钻石人) 讲的也很精辟,我基本上明白了是怎么回事了,好了,50分,你们俩分了,谢谢啊!
      

  4.   

    1. Properties is to keep some values with a certain index name. Such as: in csdn "hiking" means a certain user which names him/her as hiking. So if you want to find the certain user in csdn, just search hiking is ok.2.InitialContext gets a value named javax.naming.Context.INITIAL_CONTEXT_FACTORY inside(extends from Context). And if inside the InitialContext needs the certain content value, then check the INITIAL_CONTEXT_FACTORY is OK.3.javax.naming.Context is a special one. Cause there a lot of objects which will be used by uncertain customers. When a customer wants one of them, he/she requests the system and tells it what wanted. Then the system will search a list which is maintained by the middware applications. If matched, then the object is given the customer.(such as "java:comp/env/jdbc/emr")4.customer gets the object and demarshels it to the suitable type and uses id.