I have a large data collection app I am developing. It collects "Job Sheets" from a MySQL Server, the users view this and enter a "Daily Return Sheet" which is a list of works done (From a list view) hours worked, mileage plus other info.
This is then uploaded to the MySQL database.
I was using http requests and a php script on the server, but it is proving to be problematic, not consistent in responding to requests (the app sends a constructed SQL statement which the php script executes)
I think that using the jdbc driver and talking directly to the server/database would give me more control and responsiveness.
But.
I downloaded the B4A jdbc driver and sample code, modified it to sun a typical query, and it works fine!
But I have taken this code and am trying to build it into my app, I created a new Service module, and using the same methods and syntax as the (working) example test app, it just hangs.
the code is called thus:
RoadsJDBC is the name of the service module, and GetNewJobs is a sub within the service
however as soon as I click on the cmdUpdateDB button it just hangs!
Help?
This is then uploaded to the MySQL database.
I was using http requests and a php script on the server, but it is proving to be problematic, not consistent in responding to requests (the app sends a constructed SQL statement which the php script executes)
I think that using the jdbc driver and talking directly to the server/database would give me more control and responsiveness.
But.
I downloaded the B4A jdbc driver and sample code, modified it to sun a typical query, and it works fine!
But I have taken this code and am trying to build it into my app, I created a new Service module, and using the same methods and syntax as the (working) example test app, it just hangs.
the code is called thus:
B4X:
Sub cmdUpdateDB_Click
Wait For (CallSub(RoadsJDBC, "GetNewJobs")) Complete (Result As Boolean)
RoadsJDBC is the name of the service module, and GetNewJobs is a sub within the service
B4X:
Sub GetNewJobs As ResumableSub
Wait For (Connect) Complete (Success As Boolean)
If Success Then
Try
sSQL="SELECT * FROM statements_for_client WHERE (Client = " & Main.iUserID & " OR Client = 0) AND ID NOT IN (SELECT ID FROM statements_collected WHERE Client = " & Main.iUserID & " ) ORDER BY Requested ASC "
Dim sf As Object = mysql.ExecQueryAsync("mysql", sSQL,Null)
Wait For (sf) mysql_QueryComplete (Success As Boolean, Crsr As JdbcResultSet)
If Success Then
Do While Crsr.NextRow
Log(Crsr.GetString("Statement"))
however as soon as I click on the cmdUpdateDB button it just hangs!
Help?
Last edited: