I am new to java.when running registration.jsp page getting error
HTTP Status 500 -

--------------------------------------------------------------------------------

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

org.apache.jasper.JasperException
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:370)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)


root cause

java.lang.NullPointerException
org.apache.jsp.registration_jsp._jspService(org.ap ache.jsp.registration_jsp:95)
org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:97)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)
org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:322)
org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:291)
org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:241)
javax.servlet.http.HttpServlet.service(HttpServlet .java:802)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.9 logs.


--------------------------------------------------------------------------------

Apache Tomcat/5.5.9
=====================
My page is as:-
Registration.jsp
=====================
Code:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<jsp:directive.page import="com.ziaur.dataAccessBean"/>
<jsp:directive.page import="java.sql.ResultSet"/>

   its contain some text box
my script let are
<form action="userregst.jsp" method="post" name="contactForm">
 	<%
 	int registration_id=0;
 	dataAccessBean ob=new dataAccessBean();
 	ResultSet rs=ob.executeQuery("Select * from registeration");
 	if(rs.next())
	{
		 
		 	if(rs.next())
		 	{
		 		 registration_id=rs.getInt(1)+1;
		 	}
	}	 	
		 	else
			{
			 registration_id=1;
			}
	 		
 	 %>
========================================
and my java class dataAccessBean.java is as======
================================
Code:
package com.ziaur;
import java.sql.*;

public class dataAccessBean {
	private static String driver="sun.jdbc.odbc.jdbcodbcDriver";
	private  static String  database = "F:\\globus.mdb"; 
	private static String url="jdbc:odbc:Driver={Microsoft Access Driver (*.mdb)};DBQ="+database+";DriverID=22;READONLY=false";  
	private static String uid="";
	private static String pass="";
	Connection con=null;
	Statement st=null;
	
	
	public dataAccessBean()
	{
		try{
			Class.forName(driver);
			con=DriverManager.getConnection(url,uid,pass);
			st=con.createStatement();
		}
		catch(Exception e)
		{
			
		}
	}
	
	
	public ResultSet executeQuery(String qry)
	{
		ResultSet rs=null;
		try
		{
			System.out.println(qry);
			rs=st.executeQuery(qry);
			
		}
		catch (Exception e) 
		{

			System.out.println("data get from bean"+e.getMessage());
		}
		return rs;
		
	}
	public int executeUpdate(String qry)
	{
		int i=0;
		try{
			i=st.executeUpdate(qry);
			System.out.println(i);
		}
		catch(Exception e)
		{
			System.out.println("Exception in Query"+e.getMessage());
		}
		return i;
		
	}

}


please help me why i am getting error...kindly help me to solve it...

Last edited by shabbir; 21Aug2010 at 08:44.. Reason: Code blocks