facebook

procedure to connect the mysql using the jsp

  1. MyEclipse IDE
  2.  > 
  3. Off Topic
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #269183 Reply

    sharikishan
    Member

    i had all the requiements that are needed for connecting the mysql.i connected the mysql using the procedure given in the MyEclipse documents.I wrote jsp code to connect the mysql but that code is not connecting to the database.my code is given bellow
    <%@ page language=”java” import=”java.sql.*”%>
    <html>
    <head><title>Read from mySQL Database</title>
    </head>
    <body>
    <%
    try{
    System.out.println(“Connecting to data base”);
    Class.forName(“com.mysql.Driver”);
    Connection con=null;
    Statement stmt=null;
    con=DriverManager.getConnection(“jdbc:mysql://localhost:3306/test”,”root”,”root”);
    System.out.println(“Connected to data base”);
    stmt=con.createStatement();
    String vsql=”create table kishan(k_id integer(3) primarykey,k_name varchar(20))”;
    stmt.executeQuery(vsql);
    out.println(“created table”);
    }
    catch(Exception e)
    {
    System.out.println(e);
    }
    %>
    </body>
    </html> IS THEIR ANY PROCEDURE TO CONNECT THE CODE USING JSP IN MYECLIPSE.

    #269189 Reply

    Riyad Kalla
    Member

    Moving to OT > Soft Dev

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: procedure to connect the mysql using the jsp

You must be logged in to post in the forum log in