B4J Question [ JSql ] 1 second to insert 1 row on mysql ?

Waldemar Lima

Well-Known Member
Licensed User
Longtime User
hello everyone !
i am making tests about Jserver with JSql ( Mysql Connection )

i am using this code >:
B4X:
Sub insertrows
    Log("Init Insertion : " & DateTime.Time(DateTime.Now))
    Dim sql1 As SQL = pool.GetConnection
    sql1.BeginTransaction
    Try

        'For i = 1 To 100
            sql1.ExecNonQuery2("INSERT INTO users(name,email,pass) VALUES(?,?,?)",Array As Object("Example","mail@domain.com","XdX3162"))
            'Log(i)
        'Next
        
        sql1.TransactionSuccessful
    Catch
        Log(LastException.Message)
        sql1.RollBack 'no changes will be made
    End Try
    Log("End Insertion : " & DateTime.Time(DateTime.Now))
    sql1.Close
End Sub

I took a screenshot of the time it takes to inject only 1 single row ( the minimum insertion time is 1 second, sometimes 2 seconds )
1605504492406.png


is this normal or is my algorithm inefficient?
 
Top