[chargeable] MSMySQL - Yet another MySQL-Library (but a FAST one :-))

Anser

Well-Known Member
Licensed User
Longtime User
.

This is my MySQL library of choice and I do not have to install anything on to my clients servers and I don't have to interact with my clients database suppliers if online, I've previously wrote why I prefer this solution.

Anyway, I only ever use Base64 for images and ease of use as far as I'm concerned. I personally use the following library to quicky encode and decode Base64 images, that's my personal preference rightly or wrongly. https://www.b4x.com/android/forum/threads/base64-encode-decode-image-library.31031/

Or you could just change to Erels library but that means rewriting everything which I personally wouldn't do as this library is faster when transfering large amounts of data, I've tested them both ;)

Yes. I downloaded your Base64 encode decode library, tested and is working fine. With that I am able to read and write image data from/to TEXT column of MySQL table. Great Lib.

The problem where I am stuck is that there are other applications written in other programming languages that access this same MySql table data which expects BLOB column and binary data.

Actually I have a stored procedure where I pass the Image Data along with other columns as parameters to the stored procedure. There was no error, but the written image data (BLOB) was corrupted. I was calling oCn.QueryASync(cSql,cTaskID) to call the stored procedure. As this was not working then I went thru this whole thread around 31 pages. Finally I understood that it is not supported in this LIB and found that the alteranative way is to use PreparedStatement. Unfortunately, couldn't go further.
 
Last edited:

Erel

B4X founder
Staff member
Licensed User
Longtime User
Or you could just change to Erels library but that means rewriting everything which I personally wouldn't do as this library is faster when transfering large amounts of data, I've tested them both
Sounds strange. I'm pretty sure that both libraries are based on the same internal API.

I recommend using JdbcSQL. JdbcSQL also allows you to make async calls which is a must when you work with remote databases (not sure whether this library supports it or not).
 

Peter Simpson

Expert
Licensed User
Longtime User
Finally I understood that it is not supported in this LIB and found that the alteranative way is to use PreparedStatement. Unfortunately, couldn't go further.
.

I've never used PreparedStatement, actually I've never seen it before. I'm not sure how you're going to get around it then, you can try what @Erel said but that will probably mean a major rewrite for you. Don't forget that you will need to install the JDBC driver directly onto the server, if it's a hosted server that you will have to ask the service provider if they are willing to install the JDBC driver if its not already installed. My tests playing about it it shows that a lot of my clients suppliers do not have it installed.

Erels solution does work well and it actually easier to use in B4A than Manfred's, but I still prefer Manfred's simply because I do not have to speak to any hosting comoanies about installing the JDBC driver if it's not on the server ready.

Anyway, I'm pretty sure that Erels solution will work for you (I didn't test images to blob though), but it's just a pain to rewrite everything.

Good luck...
 

Anser

Well-Known Member
Licensed User
Longtime User
.Anyway, I'm pretty sure that Erels solution will work for you (I didn't test images to blob though), but it's just a pain to rewrite everything.
I assume that Erel's JdbcSQL solution supports writing image on BLOB columns though I have not come across any samples on writing Image data to BLOB column using JdbcSQL
.it's just a pain to rewrite everything.
Yes I do agree. Rewriting, then testing everything is a real pain. May be I should use JdbcSQL only at the point where I need to write image on BLOB column, the rest I should leave as it is for the time being.
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
I assume that Erel's JdbcSQL solution supports writing image on BLOB columns though I have not come across any samples on writing Image data to BLOB column using JdbcSQL
That's true. There is nothing special about it. It is more or less identical to how it is done with the standard SQL (SQLite) library.
 

maurizio barbera

Member
Licensed User
Longtime User
Hi boy

write:
......
conMySQL.PeparedStatement(strInsert)
conMySQL.setPeparedString(1, "1")
conMySQL.setPeparedString(2, "2")
conMySQL.setPeparedString(3, "4003")
conMySQL.setPeparedString(4, "1")
conMySQL.setPeparedString(5, "4003")
conMySQL.setPeparedString(6, DateTime.Date(DateTime.Now) & " " & DateTime.Time(DateTime.Now))
conMySQL.SetPeparedBytes(7, Buffer) ' Buffer is image streaming
conMySQL.setPeparedString(8, "Name")
conMySQL.ExecutePeparedStatement("TEST")
.......

Sub mysql_onPreparedStatementResult(meta As Map)
log("Is Here")
End Sub

log runtime:
lib: NOTFOUND 'mysql_onPreparedStatementResult

Why??? Thank's
 
Top