users@glassfish.java.net

Re: NullPointerException in ...

From: <forums_at_java.net>
Date: Thu, 5 May 2011 09:47:53 -0500 (CDT)

I have tested directly the datasource and the table+field and its working,
here is the code I used:

                     initContext = new InitialContext();
           
            DataSource pooledDataSource = (DataSource)
initContext.lookup("qDB");
            Connection connection = 
pooledDataSource.getConnection();
            ResultSet rs =
connection.createStatement().executeQuery("SELECT * FROM
TEMPLATE_QUESTIONAIRE WHERE qID = 'DISDEFAULT'");
            while(rs.next()) {
                System.out.println(rs.getString(1) + ":" +
rs.getString(2));
            }


The value 'DISDEFAULT' is the one used during startup and I'm getting a row
for it.

So the problem seems with the persistence.xml or with another configuration
spot...


--
[Message sent by forum member 'MohamzJava']
View Post: http://forums.java.net/node/798500