Online Hibernate Training just in Rs. 1000

One week online training in Hibernate ORM framework. Learn Hibernate Framework and enhance your skills. Best Online Hibernate training at 90% discount. Join Now!! Offer is valid Only for limited Period!!! Online Training Big Data and Hadoop Training Java Training  

Submit button to MySQL database?



Share on Google+Share on Google+

Submit button to MySQL database?
0 Answer(s)      5 years and 5 months ago
Posted in : JSP-Servlet

Need help linking html code to mysql database

<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<font size="10">Dealer Information </font>

Dealer name: <input type="text" name="Name" /><br />
Business Center: <input type="text" name="Business_Center" /><br />
Province: <input type="text" name="Province" /><br />
Dealer Code: <input type="text" name="Dealer_Code" /><br />
City: <input type="text" name="City" /><br />
State: <input type="text" name="State" /><br />
Level: <input type="text" name="Level" />
<td><input type="submit" name="Submit" value="Submit"></td>

String BusinessCenter=request.getParameter("Business_Center");
String Name=request.getParameter("Name");
String Province=request.getParameter("Province");
String DealerCode=request.getParameter("Dealer_Code");
String State=request.getParameter("State");
String City=request.getParameter("City");
String Level=request.getParameter("Level");

Connection connection = DriverManager.getConnection("jdbc:mysql://localhost:3306/Parts","root";, "admin");
Statement st=connection.createStatement();
int i=st.executeUpdate("insert into data(Businss_Center,Name, Province, Dealer_Code, State, City, Level) values('"+Name+"','"+Business_Center+"','"+Province+"','"+
out.println("inserted successfully");
catch(Exception e){}
View Answers

Related Tutorials/Questions & Answers: