Submit button to MySQL database?

Ads
 

Submit button to MySQL database?

Need help linking html code to mysql database

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

<form>
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" />
</form> 
<td><input type="submit" name="Submit" value="Submit"></td>
</body>
</html>


<%
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");


try{
Class.forName("com.mysql.jdbc.Driver").newInstance();
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+"','"+
        Dealer_Code+"','"+State+"','"+City+"','"+Level+"')");
out.println("inserted successfully");
}
catch(Exception e){}
%>
View Answers

Ads









Related Tutorials/Questions & Answers:
Submit button to MySQL database?
Submit button to MySQL database?
Advertisements
How to save form fields into the MySql Database without submit button in jsp?
submit button
Retrive only requird data from a table in MYSQL databade to JSP file..on a field submit button.
JSP Submit Button
image on submit button
Upgrading databases between MySQL 5.0 to MySQL 5.5
Disabling submit button using jQuery
Submit comments in database when user clicks on submit button
Struts application two submit button
On Click on Submit Button Display Data on Orderlist
browse and submit the excel sheet into mysql as a table
Click On Images of Submit Button Perform Action
how to disable submit button after login in jsp
storing details in database on clicking submit button - JSP-Servlet
need help....how to connect and disconnect multiple databases(databases created in mysql) using java and my sql
Databases
how to disable submit button in jsp using servlet when some condition is satisfied
Action Submit Html
insertin form data into databse and blank all form field when click on submit button
submit a form
Export data in excel sheet via Browse and upload button into mysql database
MySQL Client
mysqldump all databases
Switch databases
How to use next and previous button(or href) for database table that is retrieved from MySQL DB.
after entering details in reg page,n enter the submit button,how can v store the data in db, n hw can v retrive the data frm db in jsp
conflicting databases
conflicting databases
button

Ads