On 26/09/2003 17:29 CRAIG GOLBY wrote:
> [snip]
> public void init() {
> try{
> Context ctx = new InitialContext();
> if(ctx == null )
> throw new Exception("Boom - No Context");
> status = "checking CTX";
>
> DataSource ds =
> (DataSource)ctx.lookup("java:comp/env/jdbc/PersonalDb");
> status = "Completing Lookup of CTX";
>
> if (ds != null)
> {
> status = "Creating Connection";
> Connection conn = ds.getConnection(); <----- FAILS HERE
With a NullPointerException I presume? Try
DataSource ds =
(DataSource)ctx.lookupLink("java:comp/env/jdbc/PersonalDb");
And rememeber that the JDBC driver _must_ be in common/lib and _must not_
be in the classpath.
HTH
--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller
Business |
| Computer Consultants |
http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+