Jump to content

national

Members
  • Posts

    21
  • Joined

  • Last visited

Posts posted by national

  1. Now its giving me an error indicating "

    Oops! This link appears to be broken."

     

    Its giving this error from yesterday and the main thing is that none of the pages are running and at the same place if I write a html code then it is running easily...

     

    I have changed my Index.jsp to index.html, but because of html extension jsp is not running.

  2. I have googled it but there is a line of code

    class.forName("com.mysql.jdbc.Driver");

    from where Java recognizes that the given database's Driver is mysql

    for it we install mysql connector in our home pc but I think here in my account it has not been installed

    please check it in my account and if it is not there then please install it because that is the reason I am not able to host my site. nationalautomobiles.heliohost.org

  3. <p>It's also not working see my code </p>

    <p> </p>

    <div><%@page import="java.sql.*" %></div>

    <div><%</div>

    <div>try</div>

    <div>{</div>

    <div>Connection connection = DriverManager.getConnection(</div>

    <div>  "jdbc:mysql://127.0.0.1/"+"national_national",</div>

    <div>  "username",</div>

    <div>  "password"</div>

    <div>  );</div>

    <div>Statement statement = connection.createStatement();</div>

    <div>ResultSet result = statement.executeQuery("SELECT * from adminlogin");</div>

    <div>while (result.next()) { </div>

    <div>%></div>

    <div><%= result.getString(2) %>: <%= result.getString(3) %><br/></div>

    <div><% }</div>

    <div>}</div>

    <div>catch(Exception e)</div>

    <div>{</div>

    <div>session.setAttribute("Error",e);</div>

    <div>response.sendRedirect("Error.jsp");</div>

    <div>} %></div>

     

     

    <p>And the Error is </p>

    <p> </p>

    <p> </p>

    <h2 style="color: rgb(0, 0, 0); font-family: 'Times New Roman';">

    Error is    java.sql.SQLException: No suitable driver found for jdbc:mysql://127.0.0.1/national_national</h2>

     

  4. <p>ok This is my Code please see it<br />

     </p>

    <div><%-- </div>

    <div>    Document   : TestConnection.jsp</div>

    <div>    Created on : Sep 16, 2013, 11:47:41 AM</div>

    <div>    Author     : Manish Gupta</div>

    <div>--%></div>

    <div><%@page import="java.sql.*" %></div>

    <div><%@page contentType="text/html" pageEncoding="windows-1252"%></div>

    <div><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"></div>

    <div><html></div>

    <div>    <head></div>

    <div>        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252"></div>

    <div>        <title>JSP Page</title></div>

    <div>    </head></div>

    <div>    <body></div>

    <div> </div>

    <div>        <%</div>

    <div>try</div>

    <div>{</div>

    <div>Class.forName("com.mysql.jdbc.Driver").newInstance();</div>

    <div>Connection connection = DriverManager.getConnection(</div>

    <div>  "jdbc:mysql://127.0.0.1/" + "my_dbname",</div>

    <div>  "my_username",</div>

    <div>  "my_password"</div>

    <div>);</div>

    <div>Statement statement = connection.createStatement();</div>

    <div>ResultSet result = statement.executeQuery("SELECT * FROM adminlogin");</div>

    <div>while (result.next()) { </div>

    <div>%></div>

    <div><%= result.getString(2) %>: <%= result.getString(3) %><br/></div>

    <div><% }</div>

    <div>}</div>

    <div>catch(Exception e)</div>

    <div>{</div>

    <div>session.setAttribute("Error",e);</div>

    <div>response.sendRedirect("Error.jsp");</div>

    <div>}</div>

    <div> %></div>

    <div> </div>

    <div> </div>

    <div> </div>

    <div> </div>

    <div>    </body></div>

    <div></html></div>

     

     

    Please Check the Attachment

     

    <%--

    Document : TestConnection.jsp

    Created on : Sep 16, 2013, 11:47:41 AM

    Author : Manish Gupta

    --%>

    <%@page import="java.sql.*" %>

    <%@page contentType="text/html" pageEncoding="windows-1252"%>

    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">

    <html>

    <head>

    <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">

    <title>JSP Page</title>

    </head>

    <body>

     

    <%

    try

    {

    Class.forName("com.mysql.jdbc.Driver").newInstance();

    Connection connection = DriverManager.getConnection(

    "jdbc:mysql://127.0.0.1/" + "my_dbname",

    "my_username",

    "my_password"

    );

    Statement statement = connection.createStatement();

    ResultSet result = statement.executeQuery("SELECT * FROM adminlogin");

    while (result.next()) {

    %>

    <%= result.getString(2) %>: <%= result.getString(3) %><br/>

    <% }

    }

    catch(Exception e)

    {

    session.setAttribute("Error",e);

    response.sendRedirect("Error.jsp");

    }

    %>

     

     

     

     

    </body>

    </html>

     

    I hope this will help

×
×
  • Create New...