Using normal jdbc connection string
“jdbc:postgresql://localhost/playdb?user=username&password=passwd”
What would the equivalent be for jndi connection if the jndi name was
“jdbc/pg_pool” when being used in a glassfish connection pool.
I am aware that the username and password are not required, because they
are incorporated in the glassfish pool setup.
I have found many references to using jndi in rails yaml setup, but no
info on the resultant string.
JDBC connection strings are passed by sequel straight through to JDBC (as I
understand it) so I would imagine (hope) the string can be handled in JDBC
if of the correct format.
Of course I could be barking up the wrong tree with this approach, but I
vaguely remember seeing a string somewhere with “jndi” in it.
Rails must handle the yaml to produce the correct string so I suppose I need
to get my hands dirty in the rails code.
Activerecord-jdbc-adapter has the code to handle JNDI, so Sequel would
need to have something similar if it was to support it. The code looks
like this:
I thought the answer was too obvious Still, you should be able to use the
same string.
Are you sure Sequel supports jndi names this way? I don’t see anything in
the documentation that makes it look like that.
M.
JDBC connection strings are passed by sequel straight through to JDBC
(as I understand it) so I would imagine (hope) the string can be
handled in JDBC if of the correct format.
Of course I could be barking up the wrong tree with this approach, but I
vaguely remember seeing a string somewhere with “jndi” in it.
Rails must handle the yaml to produce the correct string so I suppose I
need to get my hands dirty in the rails code.
Activerecord-jdbc-adapter has the code to handle JNDI, so Sequel would
need to have something similar if it was to support it. The code looks
like this:
Where in the Activerecord-jdbc-adapter is the environment set for the
“javax.naming.InitialContext.new”?
I am getting this error
“Need to specify class name in environment or system property, or as an
applet parameter, or in an application resource file:
java.naming.factory.initial”
Where in the Activerecord-jdbc-adapter is the environment set for the
“javax.naming.InitialContext.new”?
I am getting this error
“Need to specify class name in environment or system property, or as an
applet parameter, or in an application resource file:
java.naming.factory.initial”
We don’t currently accept custom properties for the initial context,
as you can see in the code. If you want to specify them yourself, the
usual way (outside of an application server environment where they’re
normally set for you) is to put java.naming.factory.inital and related
properties inside a ‘jndi.properties’ file and put it somewhere on
your system classpath.
usual way (outside of an application server environment where they’re
normally set for you)
So using Glassfish V3 Prelude, the code should work as is, because
Glassfish should have set the context?
I should check with the glassfish forum for an answer as to why it is
not finding the jndi connection.
If you want to specify them yourself, the
usual way (outside of an application server environment where they’re
normally set for you)
So using Glassfish V3 Prelude, the code should work as is, because Glassfish
should have set the context?
I should check with the glassfish forum for an answer as to why it is not
finding the jndi connection.
Sounds like a good idea. Perhaps the base v3-prelude install does not
contain the JNDI hierarchy.
/Nick
To unsubscribe from this list, please visit:
http://xircles.codehaus.org/manage_email
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.