when i run my jsp script i get this error:
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:346)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
SchoolController.directTo(OfficeController.java:203)
SchoolController.doGet(OfficeController.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
root cause
java.lang.NullPointerException
bean.OfficeRegBean.getData(OfficeRegBean.java:179)
bean.OfficeRegBean.getEmployees(OfficeRegBean.java:141)
org.apache.jsp.employees_jsp._jspService(employees_jsp.java:71)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
OfficeController.directTo(OfficeController.java:203)
OfficeController.doGet(OfficeController.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
here is my OfficeRegBean on line 179
Statement mystatement = connection.createStatement();
and this is my method within line 179 that gets called
public ResultSet getEmployees()
{
try
{
query = "SELECT * FROM employees";
// Create the statement
Statement mystatement = connection.createStatement();
// Create the Resultset
return mystatement.executeQuery(query) ;
}
catch (SQLException sqle)
{
//System.out.println("err " + sqle.getMessage());
return null;
}
}
any solution to this errors would be great.
thanks
exception
org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:346)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
SchoolController.directTo(OfficeController.java:203)
SchoolController.doGet(OfficeController.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
root cause
java.lang.NullPointerException
bean.OfficeRegBean.getData(OfficeRegBean.java:179)
bean.OfficeRegBean.getEmployees(OfficeRegBean.java:141)
org.apache.jsp.employees_jsp._jspService(employees_jsp.java:71)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:298)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
OfficeController.directTo(OfficeController.java:203)
OfficeController.doGet(OfficeController.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
here is my OfficeRegBean on line 179
Statement mystatement = connection.createStatement();
and this is my method within line 179 that gets called
public ResultSet getEmployees()
{
try
{
query = "SELECT * FROM employees";
// Create the statement
Statement mystatement = connection.createStatement();
// Create the Resultset
return mystatement.executeQuery(query) ;
}
catch (SQLException sqle)
{
//System.out.println("err " + sqle.getMessage());
return null;
}
}
any solution to this errors would be great.
thanks