is it possible to use information input into one screen, then displayed into another screen using sql commands?
this is how i am trying to get the information required:
String sql = "";
if (cname.getText ().length () != 0)
{
sql = "SELECT CommonName, ScientificName,Type FROM Animals WHERE CommonName LIKE '" + cname.getText () + "%'";
}
else if (sname.getText ().length () != 0)
{
sql = "SELECT CommonName, ScientificName,Type FROM Animals WHERE ScientificName LIKE '" + sname.getText () + "%'";
}
ResultSet rs = stmt.executeQuery (sql);
while (rs.next ())
{
String cnameInput = rs.getString ("CommonName");
String snameInput = rs.getString ("ScientificName");
String type = rs.getString ("Type");
Search search = new Search (cnameInput,snameInput,type);
}