wood burning stoves 2.0*
The moose likes JSP and the fly likes Compare textbox data with sql table data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Compare textbox data with sql table data" Watch "Compare textbox data with sql table data" New topic
Author

Compare textbox data with sql table data

Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
I'm creating an app, that displayes a String from a database. This String is then displayed in a textbox that cannot be edited.

I now require that varible (String passed) in the text box to be compared with a column in a SQL database table which is an identical String. Once the matching String is found I need to update other columns based on the queries.

when i use request.getParameters() method it is giving output as null.

i need it to be done purely in jsp. please help.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60776
    
  65

Rakesh Keerthi wrote:I'm creating an app, that displayes a String from a database. This String is then displayed in a textbox that cannot be edited.

Please be precise when posting. Does this mean that you made the control disabled or readonly? They are not the same and which you used may be the answer to your question. Just saying "cannot be edited" doesn't give us the information we need to answer your question.

But I'm guessing that you used disabled, which means that the value will not be submitted.

i need it to be done purely in jsp

I sincerely hope that this does not mean that you are putting Java code in your JSPs!


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
Hi,
i made it read only.
here the data is getting retrieved from a sql query and below is the code that i used to do so.



and the jsp used to compare the data is as below

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60776
    
  65

Please read this JspFaq entry.
Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
Thank you very much for the suggestion but i'm new to JSP technology and i'm not aware of this subject. please help me with the JSP code

Rakesh Keerthi
Ranch Hand

Joined: Jul 16, 2012
Posts: 136
Hi Bear,
could you please help me in solving this using JSP instead of going with JSTL as it is entirely a new concept for me.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60776
    
  65

The first sep is to move the Java code out of the JSP and into a servlet controller. Please read this article for information on proper web app structure.

If you are a novice to JSP you should be learning to do things the right way rather than wasting time establishing bad habits that you'll just need to unlearn later.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compare textbox data with sql table data
 
Similar Threads
Convertion of xml file to sql file.
JBuilder -->SQL Server2000 Chinese display problem, HELP NEEDED!
How do you pull a SQL query out of this servlet code?
Uploaded file to database
How to refresh a table in Struts