NullPointerException when call executeQuery()

Hello,

i aways make the select in other select that way, but today i have no idea why executeQuery() may return a exception.

that's my code:

if( rs.next() ){

do{

if( status !=null ){

if( another condition ){

//here the try catch to do the query

try{

query ="a correctly query";

pstmt = Dao.getCon().prepareStatement( query );

//until here it's ok

es_eta = pstmt.executeQuery();//here crash, tha page just stop loading.. and don't go to the catch...

}catch(Exception e){

Dao.log("error: " + e);

}

}

}while(rs.next());

thanks for the help!

[1336 byte] By [lounaticoa] at [2007-11-27 2:29:27]
# 1
If you're getting a NPE, that means pstmt is null
tjacobs01a at 2007-7-12 2:42:39 > top of Java-index,Java Essentials,Java Programming...
# 2
yeah, but when i call pstmt.toString()it returns my query with parameters...it means that my PreparedStatement is not null or not? thanks!!
lounaticoa at 2007-7-12 2:42:39 > top of Java-index,Java Essentials,Java Programming...
# 3
es_eta = pstmt.executeQuery() ? what's the Query? look for the pstmt documentation about the method executeQuery() for this Objetc for me, I think this is the problem.
ing.carlos.sa at 2007-7-12 2:42:39 > top of Java-index,Java Essentials,Java Programming...