This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

getting textbox value for resultset  RSS feed

 
santosh garg
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to javaranch.We are Happy to have you here
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 65825
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"santosh kumar access", please check your private messages for an important administrative matter.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65825
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You need to learn how to properly structure web applications. Perhaps this article will help get you started.
 
santosh garg
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!