I have a query which needs to be executed. There were tons of examples of rowmapper all over so I took some brief idea from there.
So I have a huge query which has joins of multiple tables and it extracts some data. Depending on the data it retrieves I have constructed a class which implements rowmapper interface where all the details of the db are mapped accordingly to a bean that I have created.
Now in order to execute this query in the repository class I have written something like:
class mapthaticreated implements Rowmapper<bean>
{
public bean maprow(ResultSet rs, int row){
Bean b = new Bean();
B.setName(rs.getString(“NAME”));
...,,,,
In the repository class in one method I have written:
void getDetails(string sql){
Rowmapper <bean> row = new mapperthaticreated()
Jdbc.query(sql,mapper)
I'm getting a NullPointerException
.
Please help me know what am I doing wrong??