I am getting the java.lang.NullPointerException and i am not sure why. I am trying to use a try-catch block but it does not work. Can anyone explain what is wrong with this block?
public PriceDataAdder(Connection conn) {
try {
this.conn = conn;
statement = conn.prepareStatement("INSERT INTO `blah` (a,b,c,d,e,f,g,h,`i`,j) VALUE( ?,?,?,?,?,?,?,?,?,? )");
} catch (SQLException ex) {
Logger.getLogger(PriceDataAdder.class.getName()).log(Level.SEVERE, null, ex);
}
}