It's not a secret anymore!*
The moose likes JDBC and the fly likes Compare Values JTextField against a field in a MySQL Database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Compare Values JTextField against a field in a MySQL Database" Watch "Compare Values JTextField against a field in a MySQL Database" New topic
Author

Compare Values JTextField against a field in a MySQL Database

Declan Dee
Greenhorn

Joined: May 04, 2010
Posts: 20
Hi Gents,

Does anyone out there please provide some help or a link to where I can find a way to compare an integer that I have typed into a JTextfield against a field in a MySQL database?

For example if I type 4 into the textbox, I can compare this value to the database field and take action accordingly

I can find absolutly nothing on the net about this.

Any help or links is greatly appreciated.

I need to do the same for strings as well. I just need some links/examples to get me started

Declan

Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18669
    
    8

There's two steps.

(1) Get the number from the JTextField.

(2) Compare it to the database field.

Are you having trouble with both of those?
Declan Dee
Greenhorn

Joined: May 04, 2010
Posts: 20
Hi Paul,

I am sure I can get the value of the textField but using the getText method, I am ok there.

Is the compare part that I am not sure about

Declan D
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Compare Values JTextField against a field in a MySQL Database