Hi all ..
this jsp code when we use database access, to get the information by entering the price , my problem is that now iam using oracle as database and i dont know what are the changes that can be made here only ofcorse the path of database this i have , but string will it change because in oracle its varchar ? .. !! .. plz help.. its my first time to do this ..
Thanks :)
<html>
<body>
<%@ page import="java.sql.*" %>
<%
Connection con = null;
Statement st;
ResultSet rs;
String sql = "";
int price;
price= Integer.parseInt(request.getParameter("price"));
sql = "SELECT * FROM itemTBL where price = "+ price;
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:prodDSN");
st = con.createStatement();
rs = st.executeQuery(sql);
%>
<table border=2>
<%
while(rs.next())
{
%> <tr>
<td><%=rs.getString("prodno")%></td>
<td><%=rs.getString("prodname")%></td>
<td><%=rs.getString("price")%></td>
<td><%=rs.getString("ptype")%></td>
</tr>
<% } %>
</table>
<%
rs.close();
con.close();
}
catch(Exception ex)
{
out.print(ex.getMessage());
}
%>
</body>
</html>