Thanks - the thing about this that puzzles me is that it only give the nullpointer exception while conn is defined as static. If I change to the following code and then (tediously and wastefully) insantiate a BuildCms object from the servlet it all works fine. .... Any ideas why?
[code]
public class BuildCms {
public DataSource getJdbcPwacms() throws NamingException {
Context c = new InitialContext();
return (DataSource) c.lookup("java:comp/env/jdbc/pwacms");
}
public String getCMSPage(String page) throws NamingException, SQLException {
DataSource db = this.getJdbcPwacms();
Statement state = db.getConnection().createStatement();
ResultSet results;
[/code]
[Message sent by forum member 'hughacland' (hughacland)]
http://forums.java.net/jive/thread.jspa?messageID=243899