Quantcast
Channel: dBforums – Everything on Databases, Design, Developers and Administrators
Viewing all articles
Browse latest Browse all 13329

Using Text Box Value as the 'Where' clause in SQL query

$
0
0
i'm using javadb(netbeans) for a project and I am a total beginner.

I have a small app which searches an address database and brings back a data grid of results.

The users tpyes in all, or part of a street name into a jtextfield, hits a search button and the records are then filtered in a data grid.

I am writing simple sql queries which are working fine but I am struggling to indicate the where clause must be the jtextfield text. For example, what I need to do is the following:

SELECT * FROM tbl_addresses WHERE Street_Name = jTextfield.getstring()
but obviously that doesn't work.

Can anybody help?? Please??

Viewing all articles
Browse latest Browse all 13329

Trending Articles