Finally: MySql driver for iOS

Star-Dust

Expert
Licensed User
Longtime User
I've always worked on how to directly connect to local MySQL databases with mobile devices (Android and iOS) without the need for an RDC (remote database connector).

In the past, I'd been able to connect to Android using Java drivers (see here), but I've always wanted to connect to the database with an iPhone.

Until then, I gradually built a driver written entirely in B4X, which is also cross-platform.
It's probably not the most powerful, but just being able to do it gives me satisfaction

.
v1.gif
.
v2.gif


1765484922984.png


PS. Surely @Erel will say to use jrdc and not connect directly
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Example of use
B4X:
Private Sub ButtonConn_Click
    db.Connect(TextAddress.Text,TextUser.text,TextPassword.Text)
    Wait For db_Connected (Success As Boolean, Message As String)
    If Success Then
        db.executeQuery("SHOW DATABASES")
        wait for db_QueryResult (Success As Boolean)
        If Success Then
   
        End If
    Else
        xui.MsgboxAsync(Message,"ALERT")
    End If
  
End Sub

B4X:
private Sub ButtonQuery_Click
    db2.executeQuery($"SELECT * FROM ${Table}"$)
    wait for db2_QueryResult (Success As Boolean)
    If Success Then
        Do While db2.ResultSetNext
            log(db2.GetString2("id"))
        Loop
    End If
End Sub
 
Top