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

MohammadNew

Active Member
Licensed User
Longtime User
sir Don this is your library can not find some information on internet so when you make a simple app. that good for you trust me my friend and you can sell your simple project if you want >>> just the users need to how to use your library such as save,update,delete,search and show in listview. Thanks a lot
 

lemonisdead

Well-Known Member
Licensed User
Longtime User
just the users need to how to use your library such as save,update,delete,search and show in listview
Those are not depending on the library. They are parts of the SQL language. DonManfred's library allows you to execute them using (for example) ExecuteASync
You can, for example, find a simple tutorial about MySQL commands here : http://www.w3schools.com/sql/
 

DonManfred

Expert
Licensed User
Longtime User
just the users need to how to use your library
All possibiities are shown in Post #2 and #4 of this Thread. Including using the result-events

The aim of this library (and especially ME) is not to teach you how to work with databases!

The aim is to retrieve, store, update, delete databaseentries based on your SQL-query.
Select and Inserts are used in Post #2/#4... But if you know SQL you´ll know that it is the same if you want to delete or update. .. You just need to use the corrrect SQL-Syntax.
The lib does support all of them but you need SQL-Knowledge to create the query.

All queries will return a LIST and each item in the list is a MAP with all fields from this databaseentry.

LIST-Documentation: https://www.b4x.com/android/help/collections.html#list
MAP-Documentation: https://www.b4x.com/android/help/collections.html#map
Listview-Documentation: https://www.b4x.com/android/help/views.html#listview

And, honestly: if you need help on filling a listbox then you should start at the beginners guide again.
 

benji

Active Member
Licensed User
Longtime User
Don Manfred, i think i missed something.
I format my pc and i reinstall everything, i try use version 1.08 MSMySQL or MSMariaDB in my olds app, and then these app crashes.
I found my old version 1.02, update the app again and now works.

what i missed?
 

benji

Active Member
Licensed User
Longtime User
That's all...
in the log, i have nothing

install the package --> open --> crash

B4X:
Sub Globals
    Private btnOrden As Button
    Private btnEntrega As Button
    Private btnParametros As Button
    Dim DBEstampa As MySQL
    Dim CurOrden As Cursor
End Sub

Sub Activity_Create(FirstTime As Boolean)
   
    Activity.LoadLayout("Principal")
    Ruta = File.DirRootExternal
    If FirstTime Then
        GPS1.Initialize("GPS")
    End If
    If File.Exists(Ruta,"estampa.s3db") = False Then
        Msgbox("Se copia","Copiando...")
        File.Copy(File.DirAssets,"estampa.s3db",Ruta,"estampa.s3db")
    End If
    DBOrden.Initialize(Ruta,"estampa.s3db",False)
    DBEstampa.Initialize("MySQL","xxx.xxx.xxx.xxx","estampa","estampa01","molino",True,True)
End Sub

Sub Activity_Resume
    If GPS1.GPSEnabled = False Then
        ToastMessageShow("Please enable the GPS device.", True)
        StartActivity(GPS1.LocationSettingsIntent) 'Will open the relevant settings screen.
    Else
        GPS1.Start(0, 0)
    End If
End Sub

Sub Activity_Pause (UserClosed As Boolean)
    GPS1.Stop
End Sub



Sub btnOrden_Click
    Dim AuxMsg As Int
    CurOrden = DBOrden.ExecQuery("Select * from Orden where Estado = 'Entregado'")
    If CurOrden.RowCount <= 0 Then
        StartActivity(Orden)
    Else
        AuxMsg = Msgbox2("No tiene Orden de Carga, desea Cargar una Nueva","Orden de Carga","SI",Null,"NO",Null)
        If AuxMsg = DialogResponse.NEGATIVE Then
            StartActivity(Orden)
        Else
            Msgbox("Nueva Orden en Progreso","Orden de Carga")
        End If
    End If
End Sub
Sub btnEntrega_Click
   
End Sub
Sub btnParametros_Click
    StartActivity(Param)
End Sub
 

DonManfred

Expert
Licensed User
Longtime User
That's all...
in the log, i have nothing

install the package --> open --> crash
You file is not a mysql-database. there is no file for a mysql-database.

The lib is to connect to a MYSQL-Database hostet on a server and which is accessible trough the internet.

This is the only line which seens to belong to my lib
B4X:
 DBEstampa.Initialize("MySQL","xxx.xxx.xxx.xxx","estampa","estampa01","molino",True,True)
 

benji

Active Member
Licensed User
Longtime User
You file is not a mysql-database. there is no file for a mysql-database.

The lib is to connect to a MYSQL-Database hostet on a server and which is accessible trough the internet.

This is the only line which seens to belong to my lib
B4X:
 DBEstampa.Initialize("MySQL","xxx.xxx.xxx.xxx","estampa","estampa01","molino",True,True)

yes, is a MySQL database, estampa en my server.
if i put the old version, 1.02 and y delete "true","true", the app works
 

tamayo461

Member
Licensed User
Longtime User
Hello, I have the following error when I try to have a date data type but not configured. Other sql managers if the data show
"SqlException: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp"
"(NullPointerException) java.lang.NullPointerException: Attempt to invoke virtual method 'int anywheresoftware.b4a.objects.collections.List.getSize()' on a null object reference"
 

keirS

Well-Known Member
Licensed User
Longtime User
Hello, I have the following error when I try to have a date data type but not configured. Other sql managers if the data show
"SqlException: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp"
"(NullPointerException) java.lang.NullPointerException: Attempt to invoke virtual method 'int anywheresoftware.b4a.objects.collections.List.getSize()' on a null object reference"

This is not a problem with DonManfreds library; its a problem that Java doesn't deal with the empty Date Time stamps. In your SELECT statement you should convert your empty DateTime to a NULL. Using the NULLIF function in MySQL is probably the easiest way.

B4X:
NULLIF(DTime,"00:00:00 00:00:00")  AS DTime

Where DTime is a column of DATETIME or TIMESTAMP type.

The other way is to add a directive to the connection URL telling MYSQL to automatically convert empty DATIME's to NULL's.
 

tamayo461

Member
Licensed User
Longtime User
tnks for reply... the instruction nullif work fine, but prefer an instruction more global in the connection url, how doid?
 

tamayo461

Member
Licensed User
Longtime User
good evening, I wanted to ask how is the use of "check_connection", thanks.
tnks for reply... the instruction nullif work fine, but prefer an instruction more global in the connection url, how doid?



solved, thanks for the answers.
 
Top