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

DonManfred

Expert
Licensed User
Longtime User
What about the TASK label ? the TASK in the QUERYASYNC doesn't work..
it works fine for me

B4X:
    db.QueryASync("select Description as My_Name from Categories;","test")   
    db.QueryASync("select Description as My_Name from Categories;","test2")

MySQL_Status(true,false,0)
MySQL_QueryResult(Columns 1, Records 11,381ms,test2
(MyMap) {My_Name=Soft drinks, coffees, teas, beers, and ales}
(MyMap) {My_Name=Sweet and savory sauces, relishes, spreads, and seasonings}
(MyMap) {My_Name=Desserts, candies, and sweet breads}
(MyMap) {My_Name=Cheeses}
(MyMap) {My_Name=Breads, crackers, pasta, and cereal}
(MyMap) {My_Name=Prepared meats}
(MyMap) {My_Name=Dried fruit and bean curd}
(MyMap) {My_Name=Seaweed and fish}
MySQL_QueryResult(Columns 1, Records 11,382ms,test
(MyMap) {My_Name=Soft drinks, coffees, teas, beers, and ales}
(MyMap) {My_Name=Sweet and savory sauces, relishes, spreads, and seasonings}
(MyMap) {My_Name=Desserts, candies, and sweet breads}
(MyMap) {My_Name=Cheeses}
(MyMap) {My_Name=Breads, crackers, pasta, and cereal}
(MyMap) {My_Name=Prepared meats}
(MyMap) {My_Name=Dried fruit and bean curd}
(MyMap) {My_Name=Seaweed and fish}
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **
Activity_Resume()
The task is given back in the metadata...
 

vbmundo

Well-Known Member
Licensed User
it works fine for me

B4X:
    db.QueryASync("select Description as My_Name from Categories;","test")  
    db.QueryASync("select Description as My_Name from Categories;","test2")

The task is given back in the metadata...

???

But the SUB is allways the same ?

I need to put all code in 1 Sub for all queries ?
 

vbmundo

Well-Known Member
Licensed User
Hi,

I have this code

B4X:
        If data.Get("COLLATION_NAME")<>Null Then
           Cola=data.Get("COLLATION_NAME")
        Else
           Cola=""
        End If

And trow this error

B4X:
** Activity (main) Pause, UserClosed = false **
** Service (starter) Create **
** Service (starter) Start **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
MySQL Database not connected!
Sub NOT FOUND: 'vertablas_status
Connected to Database
** Activity (main) Pause, UserClosed = false **
** Activity (listatablas) Create, isFirst = true **
** Activity (listatablas) Resume **
** Activity (listatablas) Pause, UserClosed = false **
** Activity (estructuras) Create, isFirst = true **
** Activity (estructuras) Resume **
An error occurred:
(Line: 72) If data.Get("COLUMN_DEFAULT")<>Null Then
java.lang.NumberFormatException: For input string: "COLUMN_DEFAULT"
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (main) Resume **

Hi Donmanfred

Can you see this previous problem ?

I have this error when I tried to check if this Field return Null

Regards
 

vbmundo

Well-Known Member
Licensed User
Hi DonMandred, ok.. not problem with that.

But, I'm still hold with
java.lang.NumberFormatException

You Know, COLUMN_DEFAULT return Null sometimes and you have an Issue when you try to determine if the field is null.

I can't advance

Regards
 

vbmundo

Well-Known Member
Licensed User
what is the result of the folloging code???

B4X:
log($"->${data.Get("COLLATION_NAME")}<-"$)

nothing

The App abort when you try to show data.Get("COLUMN_DEFAULT")

COLUMN_DEFAULT is a LONGTEXT maybe your Control reject a LONGTEXT field.

See the Attached file

Regards
 

Attachments

  • LongText.jpg
    LongText.jpg
    27.6 KB · Views: 182

vbmundo

Well-Known Member
Licensed User

DonManfred

Expert
Licensed User
Longtime User
ResultSetMetaData.getColumnType should return a MySQL LONGTEXT type as java.sql.Types.LONGNVARCHAR
so the following should work?

B4X:
                      } else if(rsmd.getColumnType(i)==java.sql.Types.LONGNVARCHAR){
                          mm.Put(columnname, rs.getString(i));
rsmd = resultset metadata
mm = B4A Map to return
 

vbmundo

Well-Known Member
Licensed User
Yes, with the Keirs Control I hasn't problem to receive LongText Fields.

DonManfred, Could you consider at some point to include some Error Handler to your library? that if a SQL or Execute fails not abort or hang the APP ?

Your Lib is a Holy Grail but lacks a few things to be perfect

Thanks
 

keirS

Well-Known Member
Licensed User
Longtime User
so the following should work?

B4X:
                      } else if(rsmd.getColumnType(i)==java.sql.Types.LONGNVARCHAR){
                          mm.Put(columnname, rs.getString(i));
rsmd = resultset metadata
mm = B4A Map to return

Yes it should. Just Googled it and the MYSQL site says.

MySQL said:
All TEXT types return Types.LONGVARCHAR with different getPrecision() values (65535, 255, 16777215, and 2147483647 respectively) with getColumnType() returning -1. This behavior is intentional even though TINYTEXT does not fall, regarding to its size, within the LONGVARCHAR category. This is to avoid different handling inside the same base type. And getColumnType()returns -1 because the internal server handling is of type TEXT, which is similar to BLOB.

Also note that getColumnTypeName() will return VARCHAR even though getColumnType() returns Types.LONGVARCHAR, because VARCHAR is the designated column database-specific name for this type.

Could the bit in bold be causing you a problem?
 

vbmundo

Well-Known Member
Licensed User
Look DonManfred,

Is the best time to you to include a new Event into your Library.. an Sub MySQL_Error(Status as string) to trap any MySQL/Java error !!!

I'm waiting for your new (MySQL Longtext type) version

Regards
 
Top