I need to retrieve the records from a db sqlite and pass them to a web service through job.PostString.
only the last record is passed to the web service, also If cursor1.RowCount> 0. where am I wrong? how can i pass all the records?
B4X:
Job.Initialize("Job", Me)
cursor = SQL1.ExecQuery("SELECT * FROM nome")
If cursor.RowCount > 0 Then
For i = 0 To cursor.RowCount - 1
cursor.Position = i
Job.PostString(WS,"nome="&cursor.GetString("nome")&" ")
Next
Sorry it's perfect for sdkVersion <17, but with Android 9 it always goes wrong.
B4X:
If cursor1.RowCount > 0 Then
For i = 0 To cursor1.RowCount - 1
cursor1.Position = i
j.Initialize("", Me)
j.PostString(WS,"a="&cursor1.GetString("name")&"")
Wait For (j) JobDone(j As HttpJob)
Log(j.GetString)
If j.Success = True Then
Msgbox("ok")
End If
j.Release
Next
mistake :
Log(j.GetString) = java.io.FileNotFoundException: /data/user/0/xxxxxxxxxxxxxx/cache/1 (No such file or directory).
what can it be ? the data in cursor1.GetString ("name") is present :-(
You’re logging j.GetString before testing if j.Success is true. If j.Success happens to be false, j.GetString will have no content and throw this error. Also you are not logging j.ErrorMessage in case j.Success is false, so it’s hard to tell what is going on.
ok. I ran Log( j.ErrorMessage) is receive error : javax.net.ssl.SSLHandshakeException: Connection closed by peer...... for sdk version 28, while it is ok for sdk version 23 why ? help me :-(
ok. I ran Log( j.ErrorMessage) is receive error : javax.net.ssl.SSLHandshakeException: Connection closed by peer...... for sdk version 28, while it is ok for sdk version 23 why ?