
<%@ page import="java.sql.*" %>
<%@ page import="java.io.*" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<h2><center>TELECOM STORE INVENTORY</center></h2>
<title>Add Product</title>
<table>
<tr>
<td width="800"><p align ="center"></p></td>
</tr>
</table>
<table align="center" border="3" cellpadding="7" cellspacing="2" >
<tr>
<td width="220" align="center" bgcolor="#B0C4DE"><font size="5" ><a href="main1.html"> Home </a></font></td>
<td width="220" align="center" bgcolor="#B0C4DE"><font size="5" color=""><a href="main2.html"> Product </a></font></td>
<td width="220" align="center" bgcolor="#B0C4DE"><font size="5" color=""><a href="main3.html" > Stock </a></font></td>
<td width="220" align="center" bgcolor="#B0C4DE"><font size="5" color=""><a href="main4.html"> Sales Promotion </a></font></td>
</tr>
</table>
<h2><center></>UPDATE PRODUCT MODEL</center></h2>
</head>
<body>
<form name="update" method="post" action="Login">
<%
String connectionURL = "jdbc:oracle:thin:@localhost:1521:XE";
Connection connection = null;
Statement statement = null;
ResultSet rs = null;
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
connection = DriverManager.getConnection(connectionURL, "system", "ora10g");
statement = connection.createStatement();
String QueryString = "SELECT * from producttest";
rs = statement.executeQuery(QueryString);%>
<table align="center" cellpadding="10" cellspacing="10" >
<tr>
<td>Product Model Name</td>
<td><select name="productName">
<%
if ( (request.getAttribute("a") == null ))
{
while (rs.next())
{
%><option><%=rs.getString(1)%></option><%
}}
else
{%>
<option><%=request.getAttribute("a")%></option>
<%} %>
</select></td>
<td><input type="submit" value="Search" name="searchproduct"></input></td>
</tr>
<%
if ( (request.getAttribute("a") != null )||(request.getAttribute("b") != null ) || (request.getAttribute("c") != null ) || (request.getAttribute("d") != null) || (request.getAttribute("e") != null ) )
{
%>
<tr>
<td>features</td>
<th><input type="text" name="features" value=<%=request.getAttribute("b")%>></th>
</tr>
<tr>
<td>Description </td>
<th><input type="text" name="Description" value=<%=request.getAttribute("c")%>></th>
</tr>
<%}
else
{%>
<tr>
<td>features</td>
<th><input type="text" name="features"></th>
</tr>
<tr>
<td>Description</td>
<th><input type="text" name="Description"></th>
</tr>
<% }%>
</table>
<center><input type="submit" value="UPDATE" name="updateproduct"></center>
</body>
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.