I get java.lang.NullPointerException error while running the program. Seems like the error appears to be inside the try block: 
rs = st.executeQuery(query); 
of the method regcustomers in the below Java code. Please review my code and help me understand what I have done wrong.
import java.io.IOException;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.vastika.serlvet.dao.ConnectionDb;
public class RegistrationServlet extends HttpServlet {
    /**
     * 
     */
    private static final long serialVersionUID = 1L;
    protected void doGet(HttpServletRequest req, HttpServletResponse res)
            throws ServletException, IOException {
        // Read the data
        String name = req.getParameter("name");
        String email = req.getParameter("email");
        String line1 = req.getParameter("addressline1");
        String city = req.getParameter("city");
        String state = req.getParameter("state");
        String country = req.getParameter("country");
        String userid = req.getParameter("username");
        String password = req.getParameter("password");
        insertToDatabase(name, email, line1, city, state, country, userid,
                password);
        // Forward to Shopping page
        req.getRequestDispatcher("shop.html").forward(req, res);
    }
    private void insertToDatabase(String name, String email, String line1,
            String city, String state, String country, String userid,
            String password) {
        ConnectionDb con = new ConnectionDb();
        Statement st = con.makeConnection();
        ResultSet rs = null;
        String query = "insert into regcustomers (Name, Email, Address, City, State, Country, Username, Password) values("+"'"+name+"'"+","+"'"+email+"'"+","+"'"+line1+"'"+","+"'"+city+"'"+","+"'"+state+"'"+","+"'"+country+"'"+","+"'"+userid+"'"+","+"'"+password+"'"+");";
        System.out.println(query);
        try {
            rs = st.executeQuery(query);
            System.out.println(rs.getRow());
            } 
        catch (SQLException e) {
            e.printStackTrace();        
            }
    }
}
and
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.Statement;
public class ConnectionDb {
    public Statement makeConnection() {
        Connection conn = null;
        Statement st = null;
        try {
            Class.forName("com.mysql.jdbc.Driver");
            conn = DriverManager.getConnection(
                    "jdbc:mysql://localhost:3306/onlineshopping", "root",
                    "test");
            st = conn.createStatement();
        } catch (Exception e) {
            e.getStackTrace();
        }
        return st;
    }
}
 
     
     
     
     
    