posts - 97,  comments - 93,  trackbacks - 0
          Today with tomcat admin, a Graphic interface for us to config the JNDI for our program,I configured the context and connection pool jioning IBM DB2 ExC-9.Actually,JNDI is an API specified in Java technology that provides naming and directory functionality to applications written in the Java programming language. It is designed especially for the Java platform using Java's object model. Using JNDI, applications based on Java technology can store and retrieve named Java objects of any type. In addition, JNDI provides methods for performing standard directory operations, such as associating attributes with objects and searching for objects using their attributes (Name-Value,context).JNDI is also defined independent of any specific naming or directory service implementation. It enables applications to access different, possibly multiple, naming and directory services using a common API. Different naming and directory service providers can be plugged in seamlessly behind this common API. This enables Java technology-based applications to take advantage of information in a variety of existing naming and directory services, such as LDAP, NDS, DNS, and NIS(YP), as well as enabling the applications to coexist with legacy software and systems. Using JNDI as a tool, we can build new powerful and portable applications that not only take advantage of Java's object model but are also well-integrated with the environment in which they are deployed.
          A directory is typically used to associate attributes with objects. A person object, for example, can have a number of attributes, such as the person's surname, fisrtName,telephone numbers, electronic mail address and so on. Using JNDI, to retrieve the email address of a person object, the code looks as follows.
          1 Attribute personAttribute=directory.getAttributes(personName).get("email");
          2 String email = (String)personAttribute.get();
          (Recently,finding that blogjava can help us format our code,that's perfect,but if can max the editor area which will enhance the function and coursely be better:).)
          An intuitive model for the Java programmer is to be able to lookup objects like printers and databases from the naming/directory service. Using JNDI, to lookup a printer object, the code looks as follows. (it's important and most used)
          1 Printer printer =(Printer)namespace.lookup(printerName);
          2 printer.print(document);

          posted on 2007-04-08 15:10 wqwqwqwqwq 閱讀(473) 評(píng)論(0)  編輯  收藏 所屬分類: Simple Java
          <2007年4月>
          25262728293031
          1234567
          891011121314
          15161718192021
          22232425262728
          293012345




          常用鏈接

          留言簿(10)

          隨筆分類(95)

          隨筆檔案(97)

          文章檔案(10)

          相冊(cè)

          J2ME技術(shù)網(wǎng)站

          java技術(shù)相關(guān)

          mess

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          校園夢(mèng)網(wǎng)網(wǎng)絡(luò)電話,中國(guó)最優(yōu)秀的網(wǎng)絡(luò)電話
          主站蜘蛛池模板: 观塘区| 双柏县| 恩平市| 合作市| 静乐县| 永善县| 固安县| 大石桥市| 濮阳县| 鄂温| 永泰县| 新巴尔虎左旗| 元江| 策勒县| 吉隆县| 保靖县| 浮梁县| 林口县| 沈阳市| 潼南县| 新田县| 牙克石市| 顺义区| 郯城县| 永昌县| 柳江县| 太保市| 莒南县| 东兴市| 左权县| 政和县| 修文县| 大名县| 阿城市| 达州市| 陆川县| 平江县| 旬邑县| 雅安市| 安乡县| 洛阳市|