am tring get value from msaccses database with wher condition but am not get. pls give me an idea to overcome this problum. and pls..help to get data from table based on the dropdownlist vaues wich is in html page. using jsp, jdbc.......pls.....
<%@ page import="java.sql.*" %>
<%@page contentType="text/html" %>
<% Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); %>
<HTML>
<HEAD>
<TITLE>Selecting tableName From a Database</TITLE>
</HEAD>
<BODY>
<H1>Selecting tableName From a Database</H1>
<%
Int id = request.getValue("s1");
Connection connection = DriverManager.getConnection("jdbc:odbc:push1", " ", " ");
Statement statement = connection.createStatement() ;
ResultSet resultset = statement.executeQuery("select * from T1 where PART_NUMBER =7125") ;
//ResultSet resultset = statement.executeQuery("select * from t1 where PART_NUMBER = "+request.getParameter('s1')") ;
//ResultSet resultset = statement.executeQuery("select * from T1 where PART_NUMBER ='"+id+"'") ;
//ResultSet resultset = statement.executeQuery("select * from T1 where PART_NUMBER =id") ;
ResultSet resultset = statement.executeQuery("select * from T1 where PART_NUMBER ='"+id+"'");
%>
<TABLE BORDER="1">
<TR>
<TH>PART_NUMBER</TH>
<TH>DESCRIPTION</TH>
<TH>PRICE</TH>
</TR>
<% while(resultset.next()){ %>
<TR>
<TD> <%= resultset.getInt(1) %></td>
<TD> <%= resultset.getString(2) %></TD>
<TD> <%= resultset.getInt(3) %></TD>
</TR>
<% } %>
</TABLE>
</BODY>
</HTML>