Hi,
I have following code. I am using MySql database. and Tomcat server and MySql jdbc driver. I am able to get the Datasource but when I call getConnection on ds, I get Connection object as null. Any help here?
ctx = new InitialContext();
if( ctx == null ) throw new Exception("ERROR - No Context");
//**************************//
// ESTABLISH THE DataSource //
//**************************//
ds = (DataSource)ctx.lookup("java:comp/env/jdbc/xmediaDB");
if( ds == null ) throw new Exception("ERROR - DataSource is null");
//**************************//
// ESTABLISH THE Connection //
//**************************//
con = ds.getConnection();
if( con == null ) throw new Exception("ERROR - Failed to get connection");