Hi
i have the html page to connect the jsp.
<html>
<body>
<form id="form1" name="form1" method="post" action="http://localhost:8080/admin/Example.jsp">
<textarea name="textarea" cols="" rows=""></textarea>
<input type="submit" name="Submit" value="Submit" />
</form>
</body>
</html>
in this how to match the text field with jsp page. for example in text field i enter the table select option the corresponding table will be displayed.
In jsp i wrote the code that will diplay the content of the particular table. but my problem is how to match it.
the jsp code is
<%@ page import="java.sql.*" %>
<%
//String connectionURL = ("jdbc:mysql://localhost:3306/test";user="root";password="icc");
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
%>
<html><body>
<%
Class.forName("com.mysql.jdbc.Driver").newInstance ();
connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "root", "index");
statement = connection.createStatement();
rs = statement.executeQuery("select * from profit");
while (rs.next()) {
out.println(rs.getString("name")+"<br>");
out.println(rs.getString("id")+"<br>");
out.println("inserted" +"<br>");
}
rs.close();
%>
in the html text filed i enter select * from profit the above code is executed otherwise not excuted.
please give me your advice
Thanks in advance
Sang.