Hi guys
I created a very small sub to create test Users into my DataBase.Login table.
The columns are Username, EMail, Salt, Hash.
Using Heidi I can see the columns contents, including the byte arrays(?) from the Salt and Hash fields.
I then created a sub to retrieve the Salt for that User, using the username and EMail fields as search criteria.
The sub returns successfully one (1) record, which is what I want, but I just can't find a way to either test the retrieved bytes length, nor to convert them to a "visible" format...
Since I am "throwing" the retrieved value from one module into another, I need to make sure of the bytes integrity...
but just assigning the value is throwing me a cast exception!
From what I can figure, apparently I am NOT getting the Byte from my table... but then, what am I getting and why?
[EDIT]
so after a few more minutes digging into this, and changing from "result.columns.get...." to "result.rows.get(0)" I am now getting something, apparently an Object...
But I don't get it, how do I get my bytes???
I created a very small sub to create test Users into my DataBase.Login table.
The columns are Username, EMail, Salt, Hash.
Using Heidi I can see the columns contents, including the byte arrays(?) from the Salt and Hash fields.
I then created a sub to retrieve the Salt for that User, using the username and EMail fields as search criteria.
The sub returns successfully one (1) record, which is what I want, but I just can't find a way to either test the retrieved bytes length, nor to convert them to a "visible" format...
Since I am "throwing" the retrieved value from one module into another, I need to make sure of the bytes integrity...
but just assigning the value is throwing me a cast exception!
B4X:
Main.ToolBar1.MyLogIn.Salt=result.Columns.Get("Salt")
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.ClassCastException: java.lang.Integer cannot be cast to [Byte]
From what I can figure, apparently I am NOT getting the Byte from my table... but then, what am I getting and why?
[EDIT]
so after a few more minutes digging into this, and changing from "result.columns.get...." to "result.rows.get(0)" I am now getting something, apparently an Object...
But I don't get it, how do I get my bytes???
Last edited: