JNDI主要用于在容器中配置某些资源,让所有项目可以使用。
JNDI可以提供:

1:数据库连接池。
            自定义连接池
             第三方连接池
       Dbcp
                    C3p0
                     JNDI
2:邮件服务器定义。
3:加载任意的类,让所有项目都可以使用。
        JNDI:[定义在tomcat容器中,所有项目必须要通过查找的方式获取这个服务Javax.naming.Context 环境(ENV)上下文。
                     它的一个了类:InitialContext

配置JNDI,不用发布项目

1、配置tomcat/conf/server.xml

 <Context path="/aaa" docBase="D:\\Adnroid\\Workspaces\\day25\\WebRoot">
<Resource name="jdbc/mysql" auth="Container" //name--JNDI名称 auth--JNDI拥有者
type="javax.sql.DataSource" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql:///bookstore?characterEncoding=UTF8"
username="root" password="mysql" maxActive="10" maxIdle="30"
maxWait="-1"/>
</Context>
</Host>

2、将mysql-connection.jar放到tomcat/lib目录下

3、在java项目中引用 在代码中直接查询这个jndi:

 //1、声明上下文环境
Context ctx=new InitialContext();
//2、查找apache环境
ctx= (Context) ctx.lookup("java:/comp/env");
//3、从环境中查找JNDI
Object obj= ctx.lookup("jdbc/mysql");
/*第2,3步可以合成为obj=ctx.lookup("java:/comp/env/jdbc/mysql");*/
//4、测试
DataSource ds=(DataSource) obj;
Connection conn=ds.getConnection();
System.err.println(conn);

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA7wAAAAyCAIAAADwc0BVAAAUdklEQVR4nO1dOW4rSRKtS8wpJJM0xpsDyOAJBPoydAgBhBwdoD0ZAgSIbvvtNSCHQF/jWzzCGLVFRMaSS5VI/n6Bh5mvWjIjIyMiXy7F7s7n8/l8fn9/P4/y/v7+x5///PHnP+fz6bDt9sfzjwit63TYbg+n5H5y7cfkuKe6EZuQG4tKueWP+24F+/RWb2tl9dtLuJ9ulqTktCrbB732rNMLsnCp2+mw7fYH0YTTYbs9HBx9Ms27tIvftPJOGjodtt1+P6scakgekKUe992PJd5yUXvwZ7S96ChwdTJnm/W7QM9sOfmOxqCZwjTJjz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AAgAEgzAAAAAAAAAAQAaQYAAAAAAACAACDNAAAAAAAAABAApBkAAAAAAAAAAoA0AwAAAAAAAEAAkGYAAAAAAAAACADSDAAAAAAAAAABQJoBAAAAAAAAIABIMwAAAAAAAAAEAGkGAAAAAAAAgAAgzQAAAAAAAAAQAKQZAAAAAAAAAAL8H/UCWw9k3eTDAAAAAElFTkSuQmCC" alt="" />

注:

一般来说不会修改/server.xml,会在aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAkAAAAAlCAIAAAAlXsGhAAAE9UlEQVR4nO2bPVbzOhCGtYL0KejTswKvICXnQOMGFgFNGkpvImxBNXtw+XHvEkTr1l+hg85c/VlxHGLdPM9xQRxZmtFIeqVxUCMAAECFqK9//uXi4uLi4qruUtdWUAAAgDkgYAAAUCUIGAAAVAkCBgAAVYKAAQBAlSBgAABQJeoPAABAhXACAwCAKkHAAACgShAwAACoEgQMAACqBAE7AWPMbrfr+/7ahsB8CGJ1DMPQNI1SSmt9bVviGGPu7++NMX3f393dXWt0OTOWqmf9kwUBO4H1h7MErbVSSim13W69sW6M2W63SqnNZhO66R6U3/Z9v9lsUo+sEIJYXRC7rmvb9hI1u75SSp3TBAJ2LeICZrc8v7Pf+c22zmR2ONfTn1rrpmmGYUg92HWdLeatjMaYx8dH+6D71s5/21am5lVBEKsLYtu21qNlsVruOllrnWplMvRLKceZrE3AfmHKVCZgh8Ph0vZkqH3tG4Zhv9+n7O/7frfb2dGfN9j1g1zv8pVLCOI5bd1gEMsFrNwqKduTXFfATnIKAfvPsdqObHnH7emsbx8fHzb5oLV22Qk32uSD9qZLVthHwrby5h4Oh/Jwem2NPx16PB5do65zw8Kh/dbl9/d3L+cQurnO/uz7fr/fPzw8RE3VWsssSmbVcJt3b+0rHKwE8daCGLqc6T0XGluybVuv2CJWZc6ak+EIh5lMIdoNRNSXsPISU8udkgIW7eGxYPiNgYDlJ4usvOs6d/Pr6+uktX0e0ycwa6sLgJd5sJbZWWrdkyGUD9pq397evAzGqSewwnBm2nI9Lu+HhUP77R3npk12y01KypeV9KfMmYTJeu9NQ2rts8PdVeL+9hIyGQjiTQUxFYJU73mhyXhxjlUpAZsMR2qYhQIW+hJ9dkGnpPBkenhy+Hn1hJMlWrk8/bvKr59C9CLtvpJzPvp3aohIlZ4tYIVbknxb3kevcGi/t8zZZIvbYjvsNl++SL9Wf3pmeDV460LJ5r3rOu89v3O/aZrn5+fC7BNBLPex9iCGLpf0nkxmzhCwGVZJJtcor0BUwKK+hM8u6JQzI9XDhcPPxFKIcrKkwrfdbuXQWqmAWTdmzFW713PnVhvpC53AStpyH6OFy9e+yQPySvrTZp8ya18+ldS2beaXWqY4/04QbyqIJQIW9t6ZAjZZUrYlmQxHtEChgEWfXdaplIClxnnenUIBk/Js+yrc812IOSlE9w4gP1eNeE1qjDkej9Lzrutmn8BKSmbachPY3Y8WDu2PhlMWG8fx9fU1HJQr6c9B/ETNJQRkfiNcoGWx/Hw7dZUpKUkQwz6pLojREEz23jkCVlJyDE6iWuuu6ybDkRpmJQIWfXZBp0w6hShf3E4Ov7yApSrv+/7z83MUM+VqAjb+HCon31dn5uooXg/KcWDreXp6cnNJtpU3t3x0RtuyN19eXjxfUoZ59qcmWF/wYnYl/SmbdjtK97LBq19+GybZ3AB1ObfC0BDEmwpi1KTJ3pstYOVWjSJ3qn7eVk6G4/v7OyxQKGCpypdyyhT8iKNk+OUFLFO5+8WN3F+mhvEi3NY/Mv/CjgAuDUEEAAsCBpVBEAHAgoBBZRBEALDcloABAMD/BgQMAACqBAEDAIAqQcAAAKBK1B8AAIAK4QQGAABVgoABAECVIGAAAFAlCBgAAFQJAgYAAFWCgAEAQJX8BbLkwrRlnCjzAAAAAElFTkSuQmCC" alt="" />

目录下新建“项目名称.xml”,在里面插入第1步中的代码

标准DBUtils的写法

 public class DatasourceUtils {
private static DataSource ds;
static{
try{
Context ctx = new InitialContext();
ds = (DataSource) ctx.lookup("java:/comp/env/jdbc/mysql");
}catch(Exception e){
e.printStackTrace();
}
}
public static DataSource getDs(){
return ds;
}
}

JNDI--Java命名和目录接口的更多相关文章

  1. Java Naming and Directory Interface (JNDI) Java 命名和目录接口

    https://www.oracle.com/technetwork/java/jndi/index.html Lesson: Overview of JNDI (The Java™ Tutorial ...

  2. JNDI Java 命名与目录接口

    jsp <% Context ctx = new InitialContext(); String jndiName = (String) ctx.lookup("java:comp/ ...

  3. Java命名和目录接口——JNDI

    JNDI即Java命名和目录接口(JavaNaming and Directory Interface),它属于J2EE规范范畴,是J2EE的核心技术之一,提供了一组接口.类和关于命名空间的概念.JD ...

  4. JNDI(Java Naming and Directory Interface,Java命名和目录接口)

    JNDI(Java Naming and Directory Interface,Java命名和目录接口)是SUN公司提供的一种标准的Java命名系统接口,JNDI提供统一的客户端API,通过不同的访 ...

  5. spring配置JNDI(Java Naming and Directory Interface,Java命名和目录接口)数据源

    1.在tomcat下的server.xml的 <GlobalNamingResources> </GlobalNamingResources>添加下面代码 <Resour ...

  6. 命名和目录接口 JNDI-The Java Naming and Directory Interface

    命名和目录接口 JNDI-The Java Naming and Directory Interface JNDI (The Java Naming and Directory Interface)为 ...

  7. JNDI—目录接口名

    1:什么是JNDI? Java名称与目录接口:java Naming and Directory Interface未开发人员提供的查找和访问各种名称和目录的 服务和接口 2:全局的上下文配置文件: ...

  8. 利用JNDI的命名与服务功能来满足企业级API对命名与服务的访问

    包含了大量的命名和目录服务,使用通用接口来访问不同种类的服务: 可以同时连接到多个命名或目录服务上: 建立起逻辑关联,允许把名称同Java对象或资源关联起来,而不必知道对象或资源的物理ID. JNDI ...

  9. [JAVA第二课] java命名规则

    Java良好的命名规则以及代码风格可以看出来一个程序员的功底,好多公司也会注重这方面,他们招聘员工在有些时候往往就是根据一个人的代码风格来招人,所以下面就就我知道的代码风格作简要的说明一下.Java命 ...

随机推荐

  1. win2k,XP下用setupapi.dll自动安装Driver

    win2k,XP下用setupapi.dll自动安装Driver 在驱网看到54cndr 写的这篇文章,虽然自己一直都用Installshield,但还是觉得这个也是一个很好的思路,故摘录在此. 用s ...

  2. 完美解决VMware Workstation : Could not open /dev/vmmon: No such file or directory

    root@tiger:/usr/bin# cd /etc/init.d root@tiger:/usr/bin# sudo mv /usr/lib/vmware/modules/binary /usr ...

  3. Linux下Apache PHP MYSQL 默认安装路径

    apache: 如果采用RPM包安装,安装路径应在 /etc/httpd目录下apache配置文件:/etc/httpd/conf/httpd.confApache模块路径:/usr/sbin/apa ...

  4. winPcap_5_打开适配器并捕获数据包

    知道如何获取适配器的信息了,那我们就开始一项更具意义的工作,打开适配器并捕获数据包.编写一个程序,将每一个通过适配器的数据包打印出来. 打开设备的函数是 pcap_open(). (Open a ge ...

  5. C++ STL之string常用指令

    string,大小可变的字符串,有些类似于C中的字符数组. 只记载本人在ACM中常用的函数,并且全部经过程序测试. 1.初始化 string s1;——默认构造函数s1为空串 string s2(s1 ...

  6. linux补包

    1.挂载文件export LANG=Cmkdir -p /media/cdrommount /dev/cdrom /media/cdrommount /dev/hdc /media/cdrommoun ...

  7. OC可变參数的函数实现va_start、va_end、va_list的使用

    一.简单介绍 我们常常在编程的时候看见类似这种代码,如图1.1 图1.1 或者是这种可变參数,如图1.2 图1.2 二.基本知识介绍 在学习怎样写这样的格式的函数前,先简介几个经常使用的宏: 下面摘自 ...

  8. [Protractor] Testing With Protractor Page Objects

    Protractor Page Objects are a recommended for testing your AngularJS applications. Page Objects abst ...

  9. OpenStack Neutron DVR L2 Agent的初步解析 (一)

    声明: 本博客欢迎转载,但请保留原作者信息! 作者:林凯 团队:华为杭州OpenStack团队 OpenStack Juno版本号已正式公布,这是这个开源云平台的10个版本号,在Juno版的Neutr ...

  10. Qt Style Sheets Reference

    Qt Style Sheets support various properties, pseudo-states, and subcontrols that make it possible to ...