Android Question JDBC MySQL

gbzrope

Member
Licensed User
Is there any way to validate that an INSERT query was succesfull on a remote MySQL database?
Other than to then run another query to retrieve the recordset created?

e.g.
B4X:
sSQL="INSERT INTO statements_collected(ID, Client, DeviceID) VALUES(" & Crsr.getint("ID") & "," & Main.iUserID & ",'" & MainOptions.sDeviceID & "')"
                    mysql.ExecNonQuery(sSQL)
 

gbzrope

Member
Licensed User
1. It is a mistake to use the non-async methods with JdbcSQL.
2. Check the Success parameter. If it is true then the command was executed successfully.

I tried ExecQueryAsync but that expects a recordset, this is just an Insert query, and ExecQueryAsync does not work.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0

gbzrope

Member
Licensed User

Yes, I have that file, the problem is/was that the queries are quite large and I have already built them up with values.
I have just tried:
sql.AddNonQueryToBatch(sSQL, NULL)
Which seems to work.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…