I am trying to get a database connection from within a servlet using the
following code:

InitialContext ctx = new InitialContext ();
DataSource ds = (DataSource)ctx.lookup ("java:comp/env/jdbc/oracle");
conn = ds.getConnection();

I do get a DataSource object returned (an allaire.ejipt._ejb._DataSource!?),
but ds.getConnection() is returning null, what could be causing this?
According to the API docs it's supposed to return a Connection or throw an
SQLException:

http://java.sun.com/j2ee/j2sdkee/techdocs/api/javax/sql/DataSource.html

***I think this is the root of the problem: why is my servlet getting an
allaire.ejipt._ejb._DataSource?  I am running this on a server that is not
the default server, when I try it on the default server I get an
allaire.jrun.sql.PooledDataSource, and everything works!

I thought it might be some sort of classpath issue, but
allaire.ejipt._ejb._DataSource is in ejipt.jar and ejipt.jar is found only
in the main JRun/lib directory.

Any ideas about what might be causing this?

Thanks,
Paul



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to