如何在GlassFish服务器中使用asadmin工具创建一个mysql连接池? [英] How can I create a mysql connection pool using asadmin tool in GlassFish server?

查看:153
本文介绍了如何在GlassFish服务器中使用asadmin工具创建一个mysql连接池?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用以下命令在GlassFish中创建一个mysql连接池,但它一直告诉我Command create-jdbc-connection-pool 失败。
请帮助我。
命令:

  asadmin create-jdbc-connection-pool \ 
--datasourceclassname com。 mysql.jdbc.jdbc2.optional.MysqlDataSource \
--restype javax.sql.DataSource \
--propertyUser = root:Password = ...:URL = jdbc\:mysql \:\ / \ / localhost:3306 \ / wcms_3\
connection_pool

我猜想有一个缺少的必需参数;如果我的猜测是真实的,那么需要什么参数?解析方案

也许这是一个错字,但指的是这个博客只有 - 属性必须用双引号括起来,比如:

  asadmin create-jdbc-connection-pool 
- datasourceclassname oracle.jdbc.pool.OracleDataSource
--restype javax.sql.DataSource
--property user = dbuser:password = dbpassword:url =jdbc \\:oracle \\: thin \\\:@ localhost \\:1521 \\:ORCLoracle-pool

另外请注意在这个例子中使用转义字符。


I am trying to use the following command to create a mysql connection pool in GlassFish but it keeps telling me Command create-jdbc-connection-pool failed. Please help me. The command:

asadmin create-jdbc-connection-pool \
--datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlDataSource \
--restype javax.sql.DataSource \
--property "User=root:Password=...:URL=jdbc\:mysql\:\/\/localhost:3306\/wcms_3" \
connection_pool

I guess that there is a missing required parameter; so what are the required parameters needed if my guess was true?

解决方案

Maybe it's a typo but referring to this blog only the URL-part of the --property has to be surrounded by double quotes, such as:

asadmin create-jdbc-connection-pool
        --datasourceclassname oracle.jdbc.pool.OracleDataSource 
        --restype javax.sql.DataSource 
        --property user=dbuser:password=dbpassword:url="jdbc\\:oracle\\:thin\\:@localhost\\:1521\\:ORCL" oracle-pool

Furthermore notice the use of escape characters in this example.

这篇关于如何在GlassFish服务器中使用asadmin工具创建一个mysql连接池?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆