Posted Wednesday, December 31, 1969 @ 23:59:59
Please have a look at Customerorderdemo.java sample which is in your samples directory. That explains how to do this. The find() method won't do any search in database. Find() is used to search the results in quicktable. when you want to search in database you have to recreate the select statement based on the search condition and then call the refresh() method. For example , in your case if the user enters only the customer name, change the select statement such that select * from customer_table where customer_name= (value from text field), then call teh refresh() method, now the table will be refreshed with new data.The following piece of code is taken from customerorderdemo.java, which does a similar stuff
public void showProducts()
{
//since users may switch between the order & product information through the combo box selection
//clear all the update/insert/delete sqls which are set before
//if you don't set any update/insert/delete sqls, you don't need to call this
dBTable1.clearAllUpdateSql();
dBTable1.clearAllInsertSql();
dBTable1.clearAllDeleteSql();
try
{
// set the select sql to get data from the product table
dBTable1.setSelectSql("SELECT * from Product");
//update the changes based on product number
dBTable1.addUpdateSql("update order set Product_name=? where Product_Number=?","2,1");
//Add the insert statements
dBTable1.addInsertSql("insert into order (Product_Number,Product_Name) values (?,?)", "1,2");
//Add delete statements
dBTable1.addDeleteSql("delete from order where Product_Number = ?", "1");
//fetch the data from database to fill the table
dBTable1.refresh();
}
catch(SQLException e)
{
e.printStackTrace();
}
}