1 Reply Latest reply on May 20, 2013 6:03 PM by Thiago Nascimento

    Unable to find DB Connection

    Harshit Jhaveri Newbie

      I am using JBOSS 4.2.2 GA and Oracle 11g.

      I am being able to connect to the DB through a connection tool and it works fine.

      Once I upload my WAR folder, the DB connection is lost after few minutes.

      I am using the quartz scheduler and the server log shows message like logon denied.

      I have confirmed the password as well as the access rights.

       

      The below SQL function is a UDF and the 3rd parameter accepted in this Connection is a java connection.

      The function defination is given below. Please help.

      THANKS IN ADVANCE.

       

                - Harshit Jhaveri

       

      FUNCTION :

      public String SQL(String dateformat,String SQLstr ,Connection con,String logLabel)

          {

                  String sessionquery="alter session set nls_date_format='"+dateformat+"'";

                 

                  try

                  {

                    Statement stmt = con.createStatement();

                    int str=stmt.executeUpdate(sessionquery);

                    String reccount="0";

                        //System.out.println(str);

                        ResultSet rs = stmt.executeQuery(SQLstr);

                        ResultSetMetaData rsmd  = rs.getMetaData();

                        int totalcol = rsmd.getColumnCount();

                      ///System.out.println(totalcol);

                        StringBuffer JString=new StringBuffer("");

                      //String JString="";

                   

                     -- Rest of the function

      }

       

       

      ERROR :

      javax.servlet.ServletException: javax.script.ScriptException: sun.org.mozilla.javascript.internal.EvaluatorException:

      Can't find method custom.classes.dbUtils.SQL(string,string,sun.org.mozilla.javascript.internal.Undefined,string).

      (<Unknown source>#99) in <Unknown source> at line number 99

      org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:850)

      org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:779)

      org.apache.jsp.Server_jsp._jspService(Server_jsp.java:528)

      org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)

      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

      org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)

      org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:336)

      org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)

      javax.servlet.http.HttpServlet.service(HttpServlet.java:803)

      org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)