• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Retrieve record from db

Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hai to all,
please help me to retrieve record one by one by click the button.
please check my code.it is not work..
my code is:

<%@ page import="java.sql.*"%>


function move()
var cu = 0
cu = parseInt(document.form1.hidden.value) + 1
document.form1.hidden.value = cu


<FORM NAME="form1" ACTION="query.jsp" >

int cu=1;

Connection con=DriverManager.getConnection("jdbc:odbc:tdsn");
if(request.getParameter("hidden") != null)

cu = Integer.parseInt(request.getParameter("hidden"));

String useri=request.getParameter("D1");

String a=request.getParameter("T1");
PreparedStatement ps=con.prepareStatement("SELECT sitetype,buildinght,towerht from tower where sitetype=? and basic.sid=tower.sid");
ResultSet rs=ps.executeQuery();


String r=rs.getString("sitetype");
String d=rs.getString("buildinght");
String f=rs.getString("towerht");


<input type="button" value="next" onclick="move();">
<input type="hidden" name="hidden" value="<%=cu%>">

Ranch Hand
Posts: 1183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you post an error message or where you think the code does not work?

Also, you misplaced your code tags :-)
Ranch Hand
Posts: 257
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool down Bear.. Pradeepa just seems to be a newbie like me.

Hello Pradeepa,

First replace form1.submit() to document.form1.submit();
Next, please correct your CODE tags.
Also please be kind enough to throw some light on what problem youare facing exactly and I would specifically like to know how you are setting T1, D1 etc in the request object, where and all.

Bear Bibeault
Posts: 67449
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
    Bookmark Topic Watch Topic
  • New Topic