I'm in a problem, I have a SELECT
that asks for ususario (int)
, contraseña (String)
and tipo (boolean)
of a database, I keep them in a Object [][]
, all right there, but when I want to save those 3 values in other variables separated by their type, the int
and the String
keep good, but the boolean
never takes the 1
that reaches it as a true
, that is, it is always in false
code:
result.next();{
datosObt[0][0] = result.getString( "usuario" );
datosObt[0][1] = result.getString( "contraseña" );
datosObt[0][2] = result.getString( "tipo" );//es 1
//aquí es donde obtengo los 3 datos y los guardo en el Object[][]
}
result.close();
//me salto el catch para la pregunta
//abajo los paso a los distintos tipos en los que necesito
userObt= Integer.parseInt(datosObt[0][0].toString());
pwdObt= datosObt[0][1].toString();
tipoObt= Boolean.parseBoolean(datosObt[0][2].toString());//es 1 pero el tipoObt permanece false
As I say, the first two "transformations" work well, but the third to boolean
did not want to work. I hope you can give me a hand. Thanks