0

I have multiple domains in a glassfish 3 server. I am able to login to different domains using glassfish admin console and I want to create jdbc resource/connection pool for a particular domain (say domain2). I know, I can create it using admin console. But I want to do it through CLI. I checked the format of create-jdbc-connection-pool and create-jdbc-resource commands. It does not take any parameter where I can specify the domain name.

Can somebody tell me how to do this using CLI.

Thanks in advance.

Newbie
  • 2,979
  • 9
  • 34
  • 41

1 Answers1

0

The resources are stored within the domain, so you implicitly define the domain when logging in. If you login to domain2, the resources are created in domain2. You can further define the target of the resource by using --target clause on each create-blah command. The target would be a server or a cluster within the domain you have logged in and issue the command against.

Tasos P.
  • 3,994
  • 2
  • 21
  • 41
  • 1. Can't I execute asadmin commands directly without logging in to any domain? 2. This is the description for --target option in `create-jdbc-connection-pool` command - Do not specify this option. This option is retained for compatibility with other releases. If you specify this option, a syntax error does not occur. Instead, the subcommand runs successfully and the option is silently ignored. – Newbie Nov 25 '13 at 10:25
  • 1. It depends. For example, `start domain domainName` is executed locally and does not require login to a domain. However, all remote sub-commands (like `create-jdbc-resource`) requires a domain into which the command is executed. – Tasos P. Nov 25 '13 at 11:57
  • 2. You are right: `jdbc-connection-pool` is per domain; A `jdbc-resource` on the other hand is activated on one or more `--target`s [see this](http://docs.oracle.com/cd/E18930_01/html/821-2433/create-jdbc-resource-1.html) – Tasos P. Nov 25 '13 at 11:59
  • So how to perform `create-jdbc-connection-pool` on a particular domain through `asadmin` command? – Newbie Nov 25 '13 at 12:19
  • 1
    Each domain is administered via its DAS which listens to different port. Default port for domain1 is 4848. By defining the domain's port in [asadmin](http://docs.oracle.com/cd/E19798-01/821-1758/asadmin-1m/index.html) (`asadmin --host hostName --port portNumber`) you effectively select a domain. – Tasos P. Nov 25 '13 at 12:26