Glass Fish配连接池

     这里介绍一下在怎样在Glass Fish中配连接池,希望对初学者有点帮助。

 

1、将oracle的包加入glass fish中。

     我用的是glash fish9,可将oracle的包ojdbc14.jar放入/Sun/AppServer/lib目录下。

 

2、配置。

     进入glass fish控制台:默认是http://ServerIP:4848/,进入“资源> JDBC> 连接池”,点击“新建”,填写下面三项:

    

     名称:***

     资源类型:javax.sql.ConnectionPoolDataSource

     数据库供应商:Oracle

 

     填写或选择完上面信息后,在“其它属性”中加入如下三个参数,其余的全部删除。

     

     user:

     password:

     url:jdbc:oracle:thin:@ServerIP:1521:orcl

    

     (具体参数视自己的环境作相应修改)

 

3、测试是否成功配置连接池。

     在当前新建页面中,有一个“ping”的按钮,你可以通过些入口测试你的配置是否成功。

 

4、配置JNDI,方便应用查找。

     进入glass fish控制台:默认是http://ServerIP:4848/,进入“资源> JDBC> JDBC 资源”,点击新建:

 

     JNDI 名称:  

 

     在上面的“JDNI名称”处,输入你自定义的JNDI名字,在“池名字”处,选择你刚建好的连接池名称。做完上述动   作, 可在即可。

 

5、在web应用中配置连接池。

     在你应用的web.xml或applicationContext.xml中,<beans>结点中加入如下:

     <bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
       <property name="jndiName">
         <value>***</value>
       </property>
     </bean>

    (注:“***”处填写你刚配好的JNDI名称)

 

     上面就是配置的总个过程,希望对大伙有点帮助。

     我的应用架构:struts2.x + spring + hibernate + glassFish

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
GlassFish Server 9.1 帮助手册,包括了bin目录下所有命令的详细用法,是管理、glassfish的必备工具!!!!<br><br>例如asadmin start-domain 命令:<br>Name: start-domain – starts a domain<br>Synopsis: start-domain [--domaindir domain-dir]<br> --user admin_user --passwordfile file_name<br> [--terse={true|false}] [ --echo ={true|false}]<br> [ --interactive ={true|false}] [ --verbose ={true|false}]<br> [ --debug ={true|false}] [domain_name]<br>Description: Use the start-domain command to start a domain. If the domain directory is not specified,<br> the domain in the default install_dir/domains directory is started. If there are two or more<br> domains, the domain_name operand must be specified.<br> You can use the start-domain command to upgrade domains of Application Server 8.x or 9.0<br> to Application Server 9.1. Use one of the following ways to upgrade your domain:<br>Options:<br> --domaindir<br> The directory where the domain is to be started. If specified, the path must be accessible in<br> the filesystem. If not specified, the domain in the default install_dir/domains directory is<br> started.<br> -u --user<br> The authorized domain application server administrative username.<br> --passwordfile<br> The file containing the domain application server password associated with the<br> administrative instance. The password is defined in the following form:<br> AS_ADMIN_PASSWORD=password. Where password is the actual administrator password for<br> the domain.<br> -t--terse<br> Indicates that any output data must be very concise, typically avoiding human-friendly<br> sentences and favoring well-formatted data for consumption by a script.Default is false.<br> Name<br> Synopsis<br> Description<br> Options<br> start-domain(1)<br> Sun Java System Application 658 Server 9.1 ReferenceManual ? Last Revised 11 Jul 2007<br> -e --echo<br> Setting to true will echo the command line statement on to the standard output.Default is<br> false.<br> -I --interactive<br> If set to true (default), only the required password options are prompted.<br> --verbose<br> By default this flag is set to false. If set to true, detailed server startup output is displayed.<br> On Windows, press CTRL-Break in the domain's window to print a thread dump. On<br> UNIX, press CTRL-C to kill the server and press CTRL-\\ to print a thread dump.<br> --debug<br><br>。。。。。。。。。。。。。。。。。。。。。。。。。。。<br>更多、更详细的内容请下载该文档查阅。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值