You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by SebastiĆ£o Carlos Santos <sc...@centershop.com.br> on 2003/08/19 01:17:07 UTC

JNDI DataSources

I configured Jakarta-Tomcat-4.1.27 to supply connections of my Oracle Database Server through JNDI Datasource as described in 
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples-howto.html

All accomplished the tests of JNDI Datasource HOW-TO and everything perfectly worked. Later, reading a magazine of ORACLE finds an article on Six JDBC Tips goes Enterprise Web Application (Setember/October 2002), more specifically with an example on Datasources according to code below:

...
Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("java:comp/env/jdbc/pequi");         
conn = ds.getConnection("CELIN","1951174");         
conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
...

 My question is if I can pass the user and connection password to the servant of database in the way that is being done above, because in all of the examples of JNDI Datasource HOW-TO user's name and the password are so much defined in server.xml, together with the configuration.

When executing the code I am receiving the error message 

java.lang.UnsupportedOperationException
 at datasource.OracleDataSource.conecta_datasource(OracleDataSource.java:18)

The line 18 of the code is exactly the same in that step the user and the respective password.

 Thank you

SebastiĆ£o Carlos Santos
Oracle Database Administrator - DBA 8i/9i
Oracle Certified Professional - OCP DBA 8i/9i