dcsimg
problem with jndi and tomcat in connecting postgres database
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   nuthan_kumar
Posted On:   Thursday, January 23, 2003 03:27 AM

this server.xml file code where my datasourcename is entered factory org.apache.commons.dbcp.jdbc2pool.Jdbc2PoolDataSource dataSourceName java:comp/env/jdbc/check driverClassName org.postgresql.PostgresqlDataSource url jdbc:postgresql://192.168.100.4:5432/jobs validationQuery maxIdle 10 maxActive 20 maxWait -1 username spsjob password sss this is code i have written for access from jndi in tomcat Context initContext = new InitialContext(); DataSource ds = (DataSour   More>>

this server.xml file code where my datasourcename is entered




factory org.apache.commons.dbcp.jdbc2pool.Jdbc2PoolDataSource


dataSourceName
java:comp/env/jdbc/check


driverClassName
org.postgresql.PostgresqlDataSource


url jdbc:postgresql://192.168.100.4:5432/jobs


validationQuery



maxIdle
10


maxActive
20


maxWait
-1


username
spsjob


password
sss




this is code i have written for access from jndi in tomcat

Context initContext = new InitialContext();
DataSource ds = (DataSource)initContext.lookup("java:comp/env/jdbc/chw");
java.sql.Connection con= ds.getConnection();

its throwing exception at datasource lookup itself jdbc driver "null" what is problem how to rectify it

help me out

   <<Less

Re: problem with jndi and tomcat in connecting postgres database

Posted By:   vinay_salehithal  
Posted On:   Thursday, January 23, 2003 03:14 PM

Confirm if the driver classes are in yr classpath. May be thats it.
About | Sitemap | Contact