save in variables int, String and boolean the results obtained by the ResultSet

0

I have a Object [][] where I temporarily store three values that I get from Base de Datos ,% int ,% String and% boolean , how do I pass them from:

result.next();{

    datosObt[0][0] = result.getString( "cedula" );
    System.out.println("Ususario BD: "+ datosObt[0][0]);
    datosObt[0][1] = result.getString( "password" );
    System.out.println("PWD BD: "+ datosObt[0][1]);
    datosObt[0][2] = result.getString( "tipo" );
    System.out.println("Tipo BD: "+ datosObt[0][2]);
}
    result.close();

to variables separated by each type, example

int documento;
String contrasenia;
boolean admin;

I am 100% lost, I searched and of the methods that I have seen none of them worked for me, I have now deleted everything and I have nothing of the attempts to transform them.

    
asked by Vizz3rdriX 21.10.2018 в 08:08
source

1 answer

0

It can be achieved with the following methods.

int documento= Integer.parseInt(datosObt[0][0].toString());
String contrasenia = datosObt[0][1].toString();
boolean admin= Boolean.parseBoolean(datosObt[0][2].toString());
    
answered by 21.10.2018 в 08:36