« Return to Thread: question about H2, Tomcat, JNDI and JRuby

Re: question about H2, Tomcat, JNDI and JRuby

by Murad :: Rate this Message:

Reply to Author | View in Thread

I finally got it to work jndi with jboos. Bellow is an example of files configuration.

=====oracle-ds.xml=====
<?xml version="1.0" encoding="ISO-8859-1"?>
<datasources>
        <!-- InĂ­cio: Datasource Technip -->
        <local-tx-datasource>
                <jndi-name>simu3</jndi-name>
                <connection-url>jdbc:oracle:thin:@xxx.xxx.xxx.xxx:1521:simu3</connection-url>
                <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
                <user-name>login</user-name>
                <password>password</password>
        <attribute name="MinSize">5</attribute>
        <attribute name="MaxSize">20</attribute>
        <attribute name="BlockingTimeoutMillis">5000</attribute>
        <attribute name="IdleTimeoutMinutes">15</attribute>
                <idle-timeout-minutes>5</idle-timeout-minutes>
        </local-tx-datasource>
</datasources>

=====warble.rb=====
have to enable the line in warble.rb like this:
   # Additional files/directories to include, above those in config.dirs
   config.includes = FileList["jboss-web.xml"]

   # JNDI data source name
   config.webxml.jndi = "jdbc/simu3"

=====database.yml=====
production:
  adapter: jdbc
  jndi: "java:/simu3"
  driver: oracle.jdbc.driver.OracleDriver

=====jboss-web.xml=====
<?xml version="1.0" encoding="UTF-8"?>
<jboss-web>
  <resource-ref>
    <res-ref-name>jdbc/simu3</res-ref-name>
    <jndi-name>java:/simu3</jndi-name>
  </resource-ref>
</jboss-web>


The most important thing was the creation of jboss-web.xml

Regards,
Marcelo Murad

Arun Gupta wrote:
Here is a blog entry that shows the steps for GlassFish:

http://blogs.sun.com/arungupta/entry/totd_9_using_jdbc_connection

I'd imagine similar steps for Tomcat/JBoss as well.

-Arun

Murad wrote:
> Can you please send instructions how to configure jndi on tomcat/jboss and on
> jruby?
>
> Regards,
> Marcelo Murad
>
>

 « Return to Thread: question about H2, Tomcat, JNDI and JRuby