B4J Question A question about CloudKVS: Reading from server side

schimanski

Well-Known Member
Licensed User
Longtime User
I know, that it is not a good idea to write something in the database from server-side and it is better to use the b4j client. But is it harmless to read the values from server side with the following sub?

B4X:
Public Sub GetKG(user As String, key As String) As Map
    Dim rs As ResultSet = sql.ExecQuery2("SELECT value FROM data WHERE user = ? AND key = ?", Array(user, key))
    Do While rs.NextRow
        Dim KGMap As Map
        KGMap.Initialize
        KGMap = serializator.ConvertBytesToObject(rs.GetBlob("value"))
    Loop
    rs.Close
    Return KGMap
End Sub
 

schimanski

Well-Known Member
Licensed User
Longtime User
Thanks. Sorry for asking the same question, but the project is growing faster and faster and now I have to be sure, not to make a bigger mistake...
 
Upvote 0
Top