Java Reference
In-Depth Information
Note
Since JBoss AS 7.1.0, it's mandatory that the data source be bound to the java:/ or
java:jboss/ JNDI namespace. This will standardize the resources definition among
developers, avoiding bizarre JNDI bindings.
Using the command-line interface to create a new data source
The application server provides more than one option to add a data source to your config-
uration. We will just mention the command-line interface approach, which can be quite
useful, especially if you plan to modify your configuration using script files.
Launch the jboss-cli.sh script (or jboss-cli.bat ) and connect to the applica-
tion server, as follows:
[disconnected /] connect
[standalone@localhost:9990 /]
Now issue the following command, which actually creates a new data source, accomplish-
ing the same goal we obtained by editing the configuration file:
/subsystem=datasources/
data-source=wflydevelopment:add(jndi-name=java:jboss/
datasources/wflydevelopment, driver-name=postgresql,
connection-url= jdbc:postgresql://localhost:5432/
ticketsystem,user-name="jboss",password="jboss")
The CLI should respond with a success message if everything goes well.
Search WWH ::




Custom Search