i tried below code in which i want to fetch all values when WHERE condition satisfied..and my M S Access databse contains NULL values also but when i m fetching items from database into combobox i dont want NULL values in my combo...nd below code fetches null values also..
code i tried:
if(e.getSource()==cmb_dest)
{
cmb_route.removeAll();
try
{
Connection con;
DriverManager.registerDriver(new sun.jdbc.odbc.JdbcOdbcDriver());
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
con = DriverManager.getConnection("jdbc:odbc:dsnproj","","");
Statement s = con.createStatement();
// String qry="select c_id,p_category from product";
String qry2="select * from trans_dest where
dest='"+cmb_dest.getSelectedItem()+"'";
System.out.println(qry2);
ResultSet rs=s.executeQuery(qry2);
//ResultSet rs1=s1.executeQuery(qry2);
while(rs.next())
{
cmb_route.add(rs.getString("rout1"));
cmb_route.add(rs.getString("rout2"));
cmb_route.add(rs.getString("rout3"));
cmb_route.add(rs.getString("rout4"));
}
}
catch(Exception re)
{
System.out.println(re.getMessage());
}
}
there is no error but combobox contains blank items also....