Greetings, Please if you can guide me a little, I am implementing jRDC2 and from an Android mobile I want to know the number of rows affected when sending an update query to the server, thank you very much.
The actual details depend on the db engine you are using.
If you are using MySQL for example then you can do something like:
B4X:
'jRDC2 server RDCHandler
con.BeginTransaction
Dim Total As Int
For Each cmd As DBCommand In commands
con.ExecNonQuery2(Main.rdcConnector1.GetCommand(cmd.Name), _
cmd.Parameters)
Total = Total + con.ExecQuerySingleResult("SELECT row_count()")
Next
res.Rows.Add(Array As Object(0))
res.Columns.Put("AffectedRows", Total)
con.TransactionSuccessful
The actual details depend on the db engine you are using.
If you are using MySQL for example then you can do something like:
B4X:
'jRDC2 server RDCHandler
con.BeginTransaction
Dim Total As Int
For Each cmd As DBCommand In commands
con.ExecNonQuery2(Main.rdcConnector1.GetCommand(cmd.Name), _
cmd.Parameters)
Total = Total + con.ExecQuerySingleResult("SELECT row_count()")
Next
res.Rows.Add(Array As Object(0))
res.Columns.Put("AffectedRows", Total)
con.TransactionSuccessful
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.