Reputation: 1
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.
Upvotes: 0
Views: 81
Reputation: 240956
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
Upvotes: 1