B4J Question Read write data base getting disc error

tsteward

Well-Known Member
Licensed User
Longtime User
I am trying to encrypt some fields in my sql data base to give it some protection. As this db is used on both B4J and B4A I figured this was the easiest way to go.

Anyway I get disc errors with so many read writes. seams to happen at different record number each time it runs. There must be a better way.

Error
main._encryptbtn_mouseclicked (java line: 95)
java.sql.SQLException: [SQLITE_IOERR] Some kind of disk I/O error occurred (disk I/O error)
at org.sqlite.DB.newSQLException(DB.java:383)
at org.sqlite.DB.newSQLException(DB.java:387)
at org.sqlite.DB.execute(DB.java:342)
at org.sqlite.Stmt.exec(Stmt.java:65)
at org.sqlite.Stmt.execute(Stmt.java:114)
at anywheresoftware.b4j.objects.SQL.ExecNonQuery(SQL.java:147)
at b4j.example.main._encryptbtn_mouseclicked(main.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

My Code:
B4X:
Sub EncryptBTN_MouseClicked (EventData As MouseEvent)
    Dim RS As ResultSet = sql1.ExecQuery("SELECT * FROM Vehicles")
   
    Total = RS.ColumnCount
    current = 0
    Do While RS.NextRow
        current = current + 1
        Log(current)
        EncData = b64.EncodeStoS(RS.GetString("Info"),"UTF8")
        sql1.ExecNonQuery("UPDATE Vehicles SET Info = '" & EncData & "' where VehicleID = '" & RS.GetString("VehicleID") & "'")
    Loop
    RS.Close
    sql1.Close
   
End Sub
 
Top