This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes JSP and the fly likes getting textbox value for resultset Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "getting textbox value for resultset" Watch "getting textbox value for resultset" New topic
Author

getting textbox value for resultset

santosh garg
Greenhorn

Joined: Feb 02, 2009
Posts: 10
Hi am new to jsp I want to get textbox value into resultset where condition. I am sorry if I am asking a very simple quest.

thanks
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Welcome to javaranch.We are Happy to have you here
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

There is no too simple question .Coming to your question ,

get the text field value of jsp in servlet using request.getParameter("text_field_name") returns String .Pass this into your DAO (in which java class you put the DB related stuff)class's method and Use this String Object in your where condition of your db query

Hope this helps
santosh garg
Greenhorn

Joined: Feb 02, 2009
Posts: 10
thanks for your answer, it really worked for me. Now I have another problem I want to update database when pressing update button. I am having following code with button.

<input type=button name="update"

value="Update" immediate="true" action="return update();">

but I don't know where to write my update function if I write it into <script language= javascript -- I can't get the resultset or should I declare my function into ><% function %>
I am using servlet DBConnection for database connection and update purpose and accessing with
<jsp:useBean id="ob" class="connect.DBConnection"

scope="page" />

I hope you can understand my problem.

thanks in advance
Thank you
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56179
    
  13

"santosh kumar access", please check your private messages for an important administrative matter.


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56179
    
  13

You need to learn how to properly structure web applications. Perhaps this article will help get you started.
santosh garg
Greenhorn

Joined: Feb 02, 2009
Posts: 10
Bear Bibeault wrote:You need to learn how to properly structure web applications. Perhaps this article will help get you started.


Dear Sir,
I read the prescribed article, it really helped me to understand the structure of web-application.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: getting textbox value for resultset
 
Similar Threads
Render Problem
resultset not give me result and not return data in my textbox
How to use focus() command
auto-populate a textbox
Textbox value removal