Is it possible to use oracle_enhanced with jndi connection?

13 views
Skip to first unread message

Marcelo Murad

unread,
Oct 22, 2009, 12:31:34 PM10/22/09
to oracle-...@googlegroups.com
Hi,

Is it possible to use oracle_enhanced with jndi connection?

Ex.

production:
  adapter: oracle_enhanced #jdbc
  driver: oracle.jdbc.driver.OracleDriver
  jndi: "jdbc/eval2_simu3DS"
Tanks,

--
Marcelo Murad
http://marcelomurad.com
Cel.: (55 21) 8819-5902

Raimonds Simanovskis

unread,
Oct 23, 2009, 9:02:57 AM10/23/09
to Oracle enhanced adapter for ActiveRecord
I have not done anything with JNDI.
Can you explain why is it necessary and why it is not enough to have
JDBC connection?

Raimonds

On Oct 22, 7:31 pm, Marcelo Murad <marcelo.mu...@gmail.com> wrote:
> Hi,
>
> Is it possible to use oracle_enhanced with jndi connection?
>
> Ex.
>
> production:
>   adapter: oracle_enhanced #jdbc
>   driver: oracle.jdbc.driver.OracleDriver
>   jndi: "jdbc/eval2_simu3DS"
>
> Tanks,
>
> --
> *Marcelo Murad *http://marcelomurad.com
> Cel.: (55 21) 8819-5902

Marcelo Murad

unread,
Oct 23, 2009, 10:51:09 AM10/23/09
to oracle-...@googlegroups.com
This is good for two things:

- You can create a connection pool so every application can access it, "get" a connection, use it and give it back to the pool. That saves time in opening connections and the pool is managed by Oracle Application Server.
- It is not necessary to give database access information to the application. So those information just stays in one place.

The default oracle_jdbc driver implements it. I don't know how difficult would be to implement, but I will take a look.

Thanks a lot!


--
Marcelo Murad
http://marcelomurad.com
Cel.: (55 21) 8819-5902

Renato Santos

unread,
Oct 23, 2009, 3:35:58 PM10/23/09
to oracle-...@googlegroups.com
I'd like to add one more advantage in the use of a JNDI Data Source: if the connection properties change (say, the database is migrated to another machine, and everybody forgets to warn you beforehand...), you don't need to change and/or redeploy your application or its config - the settings are changed in the data source.

Besides, there's the possibility that many other apps and services use the same data source and, again, you only need to change the connection setting in one place, instead of the config files of said apps and services.

[]'s, Renato.
Reply all
Reply to author
Forward
0 new messages