[Chargeable] MSMariaDB - Another connector to MySQL

Peter Simpson

Expert
Licensed User
Longtime User
I too don't have any stored procedures in my current database @JakeBullet70. I'm not using stored procedures with my app even though some of my MySQL queries are extremely long and complicated. I just like to see my queries as I'm coding them. I do have stored procedures in other projects but just not in my current B4A project. Sorry about that @JakeBullet70, please let me know if SPs work with this current library, cheers :p
 

JakeBullet70

Well-Known Member
Licensed User
Longtime User
Have not quite got there yet but I will. Always seems when you think it will only be a day or two of coding you really should times it by 3!! LOL
Erel just added sproc support to b4j and that is working well. (Thanks Erel!)

I will keep you all posted.
 

JakeBullet70

Well-Known Member
Licensed User
Longtime User
It WORKS!!!!

B4X:
Dim s As String = "CALL `ehome`.`eh_insert_msg_from_mqtt`('aaaa', 'topic', 'msg','cmd');"
mysql_db.ExecuteASync(s)
 

JakeBullet70

Well-Known Member
Licensed User
Longtime User
It WORKS!!!!

B4X:
Dim s As String = "CALL `ehome`.`eh_insert_msg_from_mqtt`('aaaa', 'topic', 'msg','cmd');"
mysql_db.ExecuteASync(s)

Just noticed a small issue...
When calling the sproc... The event 'MySQL_ExecResult(meta As Map)' is fired but meta is NULL.
 

Peter Simpson

Expert
Licensed User
Longtime User
Hello @JakeBullet70, sorry it's taken so long to get back to you about your query. I did a few tests using some Stored Procedures that I have in one of my MySQL databases and all my SP's fired up and returned the results as expected through @DonManfred's MSMariaDB library :)

So yes, Stored Procedures do work perfect using this library and so does the meta response in Query_QueryResult2, I'm using MySQL.QueryASync2("Call ??????????()")
 
Last edited:

Anser

Well-Known Member
Licensed User
Longtime User
I understand that this MSMariaDB is a lightweight lib.

Can I use this same MSMariaDB lib to connect to a MySQL Database ?
As this is a lightweight lib, it makes more sense to use MSMariaDB lib to connect to MySQL Database as well as to MariaDB Database.

I hope that MSMariaDB will also support the OUT parameter like the MSMySQL Lib.

Regards
Anser
 

DonManfred

Expert
Licensed User
Longtime User
Most probably Peter did all the Tests with the mariadb connector
 

Peter Simpson

Expert
Licensed User
Longtime User
Using a 'Stored Procedure':
Hey @DonManfred, Just to let you know that even though I've been helping with the questions in your other Oracle MySQL library post, I actually didn't do any of the Stored Procedure tests using that library. All my testing was actually conducted using this MariaDB MySQL library and I then gave the answers in your other post. Anyway because sooner or later I'm sure that somebody will ask the question again but in this post, I've re-posted the answer here as well ;) just to be on the safe side.

Below is a simple SP (Stored Procedure).
B4X:
DELIMITER //
CREATE PROCEDURE CountCountry(
    IN `Countries` VARCHAR(20),
    OUT `Total` INT)
BEGIN
    SELECT COUNT(*)
    INTO `Total`
    FROM `Country`
    WHERE `Name`
    LIKE CONCAT('%', Countries ,'%');
END //
DELIMITER ;
Lines in B4A that I use to query the SP above.
B4X:
'Code in B4A
   MySQL.ExecuteASync("Call CountCountry('unit', @Total)")
   MySQL.QueryASync2("SELECT @Total AS `Countries`")

Enjoy...
 
Last edited:

Peter Simpson

Expert
Licensed User
Longtime User
I understand that this MSMariaDB is a lightweight lib.

Can I use this same MSMariaDB lib to connect to a MySQL Database ?
Anser

I missed this one, the answer @Anser :p is yes you can, it also obviously connects to a MariaDB database too.

As you already know the MariaDB library is light weight, smaller in size, royalty free and just as quick as the Oracle Library.

Below is the exact same project with the exact same 174 LOC, the only difference is the library used to connect to the test database.
Untitled-2.jpg
 
Last edited:

tango

Member
Licensed User
Longtime User
hi donmanfred,
my problem is this,
at the begining of my app , it connects to mysql if there is no problem. it doesnt connect if there is a problem ina 5-10 seconds and it gives a message that it is not connected. but after connected and during that time connection become off with any problem , i want to reconnect with a condition and it begin try to reconnect . but it takes too long and lock my app and also it stops my app.

so, with your lib, can i solve this problem.
 

M.LAZ

Active Member
Licensed User
Longtime User
Hi guys,,
any free webhosting server to test this Lib,,,
Thank u
 

jahswant

Well-Known Member
Licensed User
Longtime User
Additional: Hoster which provide a free MySQL Database usually dont allow access from "outside" to this database.
So msMySql AND msMariaDB will not work on such hostings.
No some do permits external access to their server like this server. www.freemysqlhosting.net/
Problem : You need to extend your database every week by filling a captcha...And believe me it's not easy at all...
 
Top