0

I am fetching the value using query

SELECT t.revision_no 
FROM (
    SELECT MAX( CONVERT( revision_no, signed INT ) ) AS revision_no 
    FROM atps_dc 
    WHERE DATE =  '"+date+"' 
    GROUP BY CONVERT( revision_no, signed INT )) 
INNER JOIN atps_dc t 
ON t.revision_no = r.revision_no AND t.date =  '"+date+"'";

and trying to set this value using this

bA.setRev_no(rs2.getString("revision_no"));

but the compiler is giving the null pointer exception. Please help me, how can I resolve it.

Thanks in advance.

1 Answer 1

1

compiler doesn't give NullPointerException it is RuntimeException, You are pointing bA to null and then trying to invoke method on it and so the NullPointerException

DC_ChangeA bA=null; 
bA.setRev_no(rs2.getString("revision_no"));

try DC_ChangeA bA = new DC_ChangeA() or proper initialization in the place of DC_ChangeA bA = null


See

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.