You can create a datasource by a deployment plan. For example,
*Deployment Plan:*
*<?xml version="1.0" encoding="UTF-8"?>*
*<connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.2">*
* <dep:environment xmlns:dep="
http://geronimo.apache.org/xml/ns/deployment-1.2">*
* <dep:moduleId>*
* <dep:groupId>console.dbpool</dep:groupId>*
* <dep:artifactId>Test</dep:artifactId>*
* <dep:version>1.0</dep:version>*
* <dep:type>car</dep:type>*
* </dep:moduleId>*
* <dep:dependencies>*
* <dep:dependency>*
* <dep:groupId>mysql</dep:groupId>*
* <dep:artifactId>mysql-connector-java</dep:artifactId>*
* <dep:version>3.1.14</dep:version>*
* <dep:type>jar</dep:type>*
* </dep:dependency>*
* </dep:dependencies>*
* </dep:environment>*
* <resourceadapter>*
* <outbound-resourceadapter>*
* <connection-definition>*
*
<connectionfactory-interface>javax.sql.DataSource</connectionfactory-interface>
*
* <connectiondefinition-instance>*
* <name>Test</name>*
* <config-property-setting
name="DatabaseName">TestDB</config-property-setting>*
* <config-property-setting
name="UserName">admin</config-property-setting>*
* <config-property-setting
name="Password">admin</config-property-setting>*
* <connectionmanager>*
* <local-transaction/>*
* <single-pool>*
* <max-size>10</max-size>*
* <min-size>0</min-size>*
* <match-one/>*
* </single-pool>*
* </connectionmanager>*
* </connectiondefinition-instance>*
* </connection-definition>*
* </outbound-resourceadapter>*
* </resourceadapter>*
*</connector>*
*
*
Deploy Command:
To deploy a database pool from the command line using this plan,copy and
paste it to a file (say, plan-file.xml) and save it. Then run a command
like:
*cd GERONIMO_HOMEjava -jar bin/deployer.jar deploy plan-file.xml \
\repository\org\tranql\tranql-connector-mysql-local\1.6\tranql-connector-mysql-local-1.6.rar*
Add to EAR:
Instead of deploying as a top-level database pool, you can
deploy this pool as part of an EAR. To add a database pool to an EAR
using this plan:
1. Copy and paste the plan to a file
2. Save the plan file to the top level of your EAR
3. Copy the RAR file from
GERONIMO_HOME/\repository\org\tranql\tranql-connector-mysql-local\1.6\tranql-connector-mysql-local-1.6.rar
to the top level of your EAR
4. Create a META-INF/geronimo-application.xml file in your EAR
that has a module entry like this (substituting the correct RAR file
name and plan file name)
*<application
xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.1">
<environment>
<moduleId>
<artifactId>MyApplication</artifactId>
</moduleId>
</environment>
<module>
<connector>rar-file-name.rar</connector>
<alt-dd>plan-file-name.xml</alt-dd>
</module>
</application>*
You can click "Show Plan" button to refer it when you create database pool.
2013/8/19 kiranreddykasa <[email protected]>
> Hi
>
> I have created a datasource in geronimo server.
> I'm able to connect it via admin console.
>
> Can anyone let me know how to connect to this datasource by external
> standalone application via jndi.
>
> Specifically i'm not sure about these following values :
>
> java.naming.factory.initial=TO_BE_CHANGED_BY_USER
> java.naming.factory.object=TO_BE_CHANGED_BY_USER
> java.naming.factory.state=TO_BE_CHANGED_BY_USER
> java.naming.factory.control=TO_BE_CHANGED_BY_USER
> java.naming.factory.url.pkgs=TO_BE_CHANGED_BY_USER
> java.naming.provider.url=TO_BE_CHANGED_BY_USER
> java.naming.dns.url=TO_BE_CHANGED_BY_USER
>
> And also which jar should be included for this to work ??
>
>
>
> --
> View this message in context:
> http://apache-geronimo.328035.n3.nabble.com/jndi-properties-for-datasource-tp3987125.html
> Sent from the Users mailing list archive at Nabble.com.
>
--
Best Regards
Gary