B4J Library [B4X] [B4XLib] SD_SQL (direct access to MySQL, MariaDB, MS SQL, FireBird)

Star-Dust

Expert
Licensed User
Longtime User
Well, I'll give a quick summary.
To access MySql you had to import a driver or connector in C which is impossible for me because I ignore the language and compile with Host Builder.

So I decided to create a collector/driver from scratch in B4X... and it seems to work... I still have to improve and finalize ResultSet and it will take a week or more.... but it works, logs in, authenticates and reads the data

B4X:
db.Initialize(Me,"db")
db.Connect("192.168.1.103","root","password")
  
Wait For db_Connected (Success As Boolean, Message As String)
If Success Then    db.executeQuery("SHOW DATABASES")

A little piece of code:
Sub Class_Globals
    Private host As String
    Private port As Int
    Private client As Socket
    Private aStream As AsyncStreams

    Private mCakkBack As Object
    Private mEventName As String
End Sub

'Initializes the object. You can add parameters to this method if needed.
Public Sub Initialize(CallBack As Object, EventName As String)
    mCakkBack=CallBack
    mEventName=EventName & "_"
    port=3306
End Sub

Public Sub Connect(Address As String,username As String, password As String)
    host=Address
    user=username
    pass=password
    client.Initialize("client")
    client.Connect(host,port,3000)
End Sub


 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Given the many requests I have received to develop a version for iOS I imagined a more enthusiastic welcome from the forum.

I realized that I understand IT well but not people well ?
 
Last edited:

Star-Dust

Expert
Licensed User
Longtime User
Update.

Completed the MySql connector written entirely in B4X. Tried with all types and with different tables and databases. It seems to work correctly.
I just need to improve the resultSet to not keep the data in the ram memory as I receive it. But I have time to work on it...
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…