•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 428,386 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,588 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 473 | Replies: 3
![]() |
•
•
Join Date: Apr 2007
Posts: 32
Reputation:
Rep Power: 0
Solved Threads: 0
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.....
JSP Syntax (Toggle Plain Text)
<%@ 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>
Last edited by peter_budo : Jun 3rd, 2008 at 4:20 am. Reason: Keep It Organized - please use [code] tags
•
•
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation:
Rep Power: 18
Solved Threads: 199
and quite apart from that, using the bridge driver is also a VERY bad idea.
It's unstable, old, and poorly written.
Read the documentation, it's not intended to be used as more than a demo (and that a decade ago) of what JDBC is.
It's unstable, old, and poorly written.
Read the documentation, it's not intended to be used as more than a demo (and that a decade ago) of what JDBC is.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
![]() |
•
•
•
•
•
•
•
•
DaniWeb JSP Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
Similar Threads
- Please help with JSP mysql update query (JSP)
- login page using javabeans and jsp (JSP)
- Can anyone pls guide me with TechQuestions related to java (Java)
- jsp with mysql connection (JSP)
Other Threads in the JSP Forum
- Previous Thread: Sending Email through servlets and JSP
- Next Thread: how to generate a java web tree



Linear Mode