java - How to display search item in Jtable? -
i not able search particular item database , put jtable here code using: try{ string filename="stock.mdb"; string database="jdbc:odbc:driver={microsoft access driver (*.mdb)};dbq="; database += filename.trim()+ ";driverid=22;readonly=false}"; conn=drivermanager.getconnection (database, "", ""); statement sta= conn.createstatement(); string str=search.gettext(); string sql="select '"+str+"' stockdb"; resultset rs= sta.executequery(sql); table.setmodel(dbutils.resultsettotablemodel(rs)); system.out.println("search updated"); }catch(exception e) { system.out.println(e); } what wrong it? do see problem code? variable names should not start upper case character ("table" should "table"). your select statement isn't doing search. selecting column name. when search should have "...