0
Example of what I’m trying to do:
vRS = sql.executeQuery();
while(vRS.next())
{
nome = vRS.getString("nome");
cargo = vRS.getString("cargo");
}
What I want to do is when the record does not exist to display a message from System.out.Println("Does not exist in the bank!");
if (!vRS.next()) {
System.out.println("Não Encontrou cpf ou cnpj");
setVerMensagem(true);
setVerGrid(false);
}
This way works bugada which would be the correct form?
How is the table with this field? Why not check whether the field is null or empty?
– user28595
Type I want to validate Cpf with java, if the Cpf field does not exist in the base is to show an error message.
– Aline
Like this Cpf comes from the screen.
– Aline
And the query in the Czech method if this Cpf exists
– Aline
Where is this data coming from? This RS variable is a vector?
– Rafael Silva
Add more information to the question, such as the schema of this table, and how you retrieve the data from this table before checking if the field does not exist.
– user28595
vrs is the resulSet data coming from the database.
– Aline
but does the table contain or not the Cpf/cnpf field? So it is interesting to show the schema of which table you want to check this information.
– user28595
has the yes field. I want to know if there is a record for the field with id.
– Aline