title: Java.sql.SQLException: ORA-00604
body: <p>I developed a website using jsp and servlet but it gives exception 
  java.sql.SQLException: ORA-00604.After restarting the server it is working fine.
  Below is my code </p>
  
  <pre><code>public class LoginCheck extends HttpServlet {
      private static final long serialVersionUID = 1L;
  
      /**
       * @see HttpServlet#HttpServlet()
       */
      public LoginCheck() {
          super();
          // TODO Auto-generated constructor stub
      }
  
      /**
       * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
       */
      protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          // TODO Auto-generated method stub
      }
  
      /**
       * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
       */
      protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
          // TODO Auto-generated method stub
          ArrayList&lt;String&gt; appAddList = new ArrayList&lt;String&gt;();
          ArrayList&lt;String&gt; appNameList = new ArrayList&lt;String&gt;();
  
          PrintWriter out = response.getWriter();
  
          Calendar objCal1=Calendar.getInstance();
          Calendar objCal2=Calendar.getInstance();
          objCal2.set(1970,0,1,0,0,0);
          response.setDateHeader("Last-Modified",objCal1.getTime().getTime());
          response.setDateHeader("Expires",objCal2.getTime().getTime());
          response.setHeader( "Pragma" , "no-cache" );
          response.setHeader( "Cache-Control" , "no-cache" );
          response.addHeader("Cache-Control","no-store");
  
  
          Cookie cookies[] = request.getCookies();
          if(cookies != null) {
              for(int i = 0; i &lt; cookies.length; i++) {
                  cookies[i].setMaxAge(0);
                  response.addCookie(cookies[i]);
              }
          }
  
  
  
  
          HttpSession session = request.getSession();
          session.setAttribute( "user" , request.getParameter( "username" ) );
          session.setAttribute( "pass" , request.getParameter( "pass" ) );
          String user = (String)session.getAttribute( "user" );
          String pass = (String)session.getAttribute( "pass" );
          session.setMaxInactiveInterval(120);
  
          java.sql.Connection con = TSM.intf.Common.com.Common.Connection.getConnection();
          Statement stmtEmpTable = null;
          Statement stmtAppTable = null;
          PreparedStatement stmtDesigID = null;
          PreparedStatement stmtEmpTableAppAcc = null;
  
          try {
              stmtEmpTable = con.createStatement();
              stmtAppTable = con.createStatement();
  
              stmtEmpTableAppAcc = con.prepareStatement( "select appaccess from employee where empid = ?" );
              stmtDesigID = con.prepareStatement( "select desigid from employee where empid = ?" );
  
              ResultSet rsEmp = stmtEmpTable.executeQuery( "Select empid , username , userpassword , employeename from Employee" );
              ResultSet rsAppName = stmtAppTable.executeQuery( "select appname from application" );
  
              boolean correctId = false;
  
              boolean mach = false;
  
              int indexnum = Integer.parseInt( request.getParameter("index") );
  
              String[] appaccess =  null;
  
              String path = response.encodeURL(request.getContextPath() );
  
              appAddList.add( 0 , path + "\\JSP\\Login\\index.jsp");
              appNameList.add( 0 , "index" );
  
              while( rsEmp.next() ) {
                  if( user.equals( rsEmp.getString("username") ) &amp;&amp; pass.equals( rsEmp.getString("userpassword") ) ) {
                      correctId = true;
  
                      String name = rsEmp.getString("employeename");
                      String[] empName = name.split(" ");
                      String emp = "";
                      for(String str : empName) {
                          if( str.length() != 0 ) {
                              str = str.substring(0, 1).toUpperCase() + str.substring(1).toLowerCase() + " ";
                              emp += str;
                          }
                      }
  
                      session.setAttribute( "empname" , emp );
                      session.setAttribute( "empid" , rsEmp.getInt("empid") );
  
                      stmtEmpTableAppAcc.setInt( 1 , (Integer)session.getAttribute("empid") );
                      ResultSet rs = stmtEmpTableAppAcc.executeQuery();
  
                      rs.next();
                      appaccess = rs.getString("appaccess").split("#~##~#");
  
                      while( rsAppName.next() ) {
                          appAddList.add( path + "\\JSP\\Login\\" + rsAppName.getString("appname") + "Home.jsp" );
                          appNameList.add( rsAppName.getString("appname") );
                      }
  
                      stmtDesigID.setInt( 1 , (Integer)session.getAttribute("empid") );
                      ResultSet rsdesgid = stmtDesigID.executeQuery();
                      rsdesgid.next();
                      if( rsdesgid.getInt(1) == 1) {
                          appAddList.set( 1 , path + "\\JSP\\Login\\TimeManagerHome.jsp" );
                      }
  
                      for( String str : appaccess ) {
                          if( indexnum == 0) {
                              mach = true;
                              out.println("&lt;html&gt;&lt;HEAD&gt;&lt;meta http-equiv=\"refresh\" content=\"0;URL=" + appAddList.get(indexnum) + "\"&gt;&lt;/HEAD&gt;");
                              out.println("&lt;body&gt;&lt;/body&gt;&lt;/html&gt;");
                          }
                          if( str.equals( appNameList.get(indexnum) ) ) {
                              mach = true;
                              out.println("&lt;html&gt;&lt;HEAD&gt;&lt;meta http-equiv=\"refresh\" content=\"0;URL=" + appAddList.get(indexnum) + "\"&gt;&lt;/HEAD&gt;");
                              out.println("&lt;body&gt;&lt;/body&gt;&lt;/html&gt;");
                          }
                      }
                      rs.close();
                      rsdesgid.close();
                  }
              }
  
              String url = response.encodeURL(request.getContextPath() + "\\JSP\\Login\\Login.jsp");
  
              if( !correctId ) {
                  out.print( "&lt;script&gt;alert(\"Please Enter Correct UserID &amp; Password.\")&lt;/script&gt;" );
                  out.println("&lt;html&gt;&lt;HEAD&gt;&lt;meta http-equiv=\"refresh\" content=\"0;URL=" + url + "\"&gt;&lt;/HEAD&gt;");
                  out.println("&lt;body&gt;&lt;/body&gt;&lt;/html&gt;");
              }
  
              if( !mach &amp;&amp; correctId) {
                  out.print( "&lt;script&gt;alert(\"Do not use the application.\")&lt;/script&gt;" );
                  out.println("&lt;html&gt;&lt;HEAD&gt;&lt;meta http-equiv=\"refresh\" content=\"0;URL=" + url + "\"&gt;&lt;/HEAD&gt;");
                  out.println("&lt;body&gt;&lt;/body&gt;&lt;/html&gt;");
              }
  
              rsEmp.close();
              rsAppName.close();
  
          } catch( SQLException e ) {
              e.printStackTrace();
          }           
      }    
  }
  </code></pre>