java swings problem

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • swatiawasthy
    New Member
    • Jul 2008
    • 1

    java swings problem

    hi i am developing a gui in java swings and i am getting my database displayed in jtable...
    i have a textfield labeled CUSTID and my table also has its sec column as CUSTID (which is not a primary key)........... .i want that when i write a value in that textfield then, only those rows with that value of custid gets displayed in my jatable in my gui...
    plz can anyone help me??
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    So if there is no text in your JTextField you'd have to use a sql statement like this:
    "select * from yourtable", otherwise use a PreparedStateme nt like this one:
    "select * from yourtable where CUSTID = ?" and fill in the ? parameter with the
    value from obtained your JTextField. An ActionListener registered to that field
    should start the job.

    kind regards,

    Jos

    ps. btw, the name is 'Swing' not 'swings'

    Comment

    Working...