Hi all.
I am having trouble making a JNDI db connection to an Oracle 11G database under
Tomcat 7 using a tnsname. I need to use a tnsname and not the hostname / port / SID for technical reasons. Here are my resource properties (trimmed down):
<Resource
auth="Container"
name="jdbc/immv2db"
type="oracle.jdbc.xa.OracleXADataSource"
factory="oracle.jdbc.pool.OracleDataSourceFactory"
driverType="oci"
nativeXA="true"
tnsEntry="<tnsname>"
driverClassName="oracle.jdbc.OracleDriver"
user="..."
password="..."
/>
I am using the ojdbc14.jar file which comes with the Oracle client install for the Oracle OCI driver. I just get a null pointer exception (with no stack trace) when executing the following code:
InitialContext ctxss = new InitialContext();
String dbcpURL = "java:comp/env/jdbc/immv2db";
Connection c = ((DataSource) ctxss.lookup(dbcpURL)).getConnection();
ps I know that the setup is right because if I use other properties with hostname etc then I do get a connection.
Appreciate any help here.
thanks
Paul