Jump to content

[Inactive]Java, Help


mperk
 Share

Recommended Posts

Guest
This topic is now closed to further replies.
 Share

  • Similar Content

    • By Ja23
      this is  code of dbconnection.java file
       
      which is inside my javaee webapplicataion 
       
      my web application is hosted on heliohost 
       
       
      package Database;
      import java.sql.Connection;
      import java.sql.DriverManager;
       
      public class DbConnection {
      public static Connection getconnection() {
      Connection con=null;
      try {
      Class.forName("com.mysql.jdbc.Driver");//load the driver
                              
                              
      //Create the connection
      //Connection is an interface
      //Drivermanager is a class and getConnetcion()is a static metod of DriverManager class whose return type is Connection
            con=DriverManager.getConnection("jdbc:mysql://localhost:3306/yo52674_wp678"+"?verifyServerCertificate=false&useSSL=false&autoReconnect=true&useUnicode=true&characterEncoding=utf8","yo52674_R","<removed>"); 
       
      }
      catch(Exception e){
      System.out.println(e);
      }
      return con; //return the connection
      }
      }
       
      my web application is trying to connect heliohost mysql database 
      but it can only connect and perform queries when my heliohost phpmyadmin page is open  
      after when i close php my admin it gives me error
       
      e Exception Report
      Message An exception occurred processing JSP page [/userregact.jsp] at line [17]
      Description The server encountered an unexpected condition that prevented it from fulfilling the request.
      Exception
      org.apache.jasper.JasperException: An exception occurred processing JSP page [/userregact.jsp] at line [17]
      14: //String feedback = request.getParameter("feedback");
      15: Connection getconnection = DbConnection.getconnection();
      16: //String sql=;
      17: PreparedStatement st = getconnection.prepareStatement("insert into user values(?,?,?,?)");
      18:
      19: st.setString(1,username);
      20: st.setString(2,password);
      Stacktrace:
          org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:584)
          org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:481)
          org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
          org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
          org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      Root Cause
      java.lang.NullPointerException
          org.apache.jsp.userregact_jsp._jspService(userregact_jsp.java:147)
          org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
          org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:443)
          org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
          org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
          org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
      Note The full stack trace of the root cause is available in the server logs.
      Apache Tomcat/8.5.24
       
      this is  code of dbconnection.java file
    • By tonububt
      I have uploaded my war file and now want to deploy it. Username: tonububt war filename: WebApplication1
    • By softlab
      Hi.
       
      Please deploy my web app:
       
      user: bfpsw
      file: JAW.war
      server: Johnny.
       
      Thanks
    • By Deveshsingh226
      Hello Admin,
      I want you to delpoy my VASD.WAR file.
      thanks in advance.
       
      Username- demigod3
      File is uploaded through File Manger in cPanel.
       
    • By softlab
      Hi.
       
      Please deploy my web app:
       
      - user: bfpsw
      - file: JAW.war
      - server: Johnny.
       
      Thanks
×
×
  • Create New...