<%@ page import="java.util.*" %>
<%@ page import="java.sql.*" %>
<%@ page import="java.text.*" %>
<%
Statement stmt =null;
Connection conn =null;
ResultSet rs = null;
try
{
String url = "jdbc:oracle:thin:@ahmad:1521:PLSExtProc";
String user = "training";
String password = "training";
Class.forName("oracle.jdbc.driver.OracleDriver");
System.out.println("--------------");
//Get a connection to the database
conn = DriverManager.getConnection(url, user, password);
//Get a statement from the connection
stmt = conn.createStatement();
}
catch(Exception ex)
{
System.out.println("Error in creating the connection :"+ex.getMessage());
}
try
{
String Query="";
Query="select * from employee; ";
System.out.println("Query========================="+Query);
String id ="";
String name ="";
//Execute the Query and return the resultSet
rs= stmt.executeQuery(Query);
while (rs.next())
{
name = rs.getString("*");
}
rs.close();
}
catch (Exception exp)
{
System.out.println("there was an error building the xml file " + exp.getMessage());
}
finally
{
stmt.close();
conn.close();
}
%>
I am getting this error. what is it?
500 Internal Server Error
java.lang.NullPointerException at _untitled9._jspService(_untitled9.java:106) [/untitled9.jsp] at com.orionserver[Oracle Containers for J2EE 10g (10.1.3.3.0) ].http.OrionHttpJspPage.service(OrionHttpJspPage.java:59) at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:462) at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:594) at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:518) at javax.servlet.http.HttpServlet.service(HttpServlet.java:856) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:713) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:370) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.doProcessRequest(HttpRequestHandler.java:871) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:453) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.serveOneRequest(HttpRequestHandler.java:221) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:122) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].server.http.HttpRequestHandler.run(HttpRequestHandler.java:111) at oracle.oc4j.network.ServerSocketReadHandler$SafeRunnable.run(ServerSocketReadHandler.java:260) at oracle.oc4j.network.ServerSocketAcceptHandler.procClientSocket(ServerSocketAcceptHandler.java:239) at oracle.oc4j.network.ServerSocketAcceptHandler.access$700(ServerSocketAcceptHandler.java:34) at oracle.oc4j.network.ServerSocketAcceptHandler$AcceptHandlerHorse.run(ServerSocketAcceptHandler.java:880) at com.evermind[Oracle Containers for J2EE 10g (10.1.3.3.0) ].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:298) at java.lang.Thread.run(Thread.java:595)