B4A Library Yet Another MySQL Library But With Stored Procedure Support and Cursors

BarryW

Active Member
Licensed User
Longtime User
Can this work on online mysql?

Also how to insert blob such as bytes an how to retrive blobs?

Tnx
 

keirS

Well-Known Member
Licensed User
Longtime User
Can this work on online mysql?

Also how to insert blob such as bytes an how to retrive blobs?

Tnx

Yes it can; but I wouldn't recommend it as it doesn't use SSL so it's not a secure connection.

You would retrieve a blob just like you would from a cursor in SQLite. You would write a blob to a table in the same way as I have already shown you for the MariaDB library.
 

kuntasev

Member
Licensed User
Longtime User
A silly question,
What is the difference between this library and "Asynchronous MariaDB/MySQL Library"?.
Which of the two is best to work with MYSQL and what is more updated ?.
Why not unify the two into one?

Thx.
 

keirS

Well-Known Member
Licensed User
Longtime User
A silly question,
What is the difference between this library and "Asynchronous MariaDB/MySQL Library"?.
Which of the two is best to work with MYSQL and what is more updated ?.
Why not unify the two into one?

Thx.

  1. They use two different JDBC drivers. Maria DB is LPGL licensed so is free for commercial use and the MYSQL one uses the official MySQL JDBC driver.
  2. The MariaDB library does not support Stored Procdures to the same extent as the MySQL one. It doesn't support returning multiple result sets from one procedure for example.
  3. The MySQL one returns cursors and the MariaDB one returns a Map per record.
  4. The MariaDB one is more fault tolerant. The MySQL one not so much.

There are quite a lot of code differences between the two. They were written for two different projects withe very differing requirements. The MySQL one is actually a subset of a much bigger Java library where the cursors are mutable so you can change the values stored in the rows, add new rows and delete rows and then update the MySQL DB. So going forward this library is likely to be more updated, but I would probably make a version with mutable cursors chargeable.

  • "MySQLCursor
    Methods:
    • Add (addMap As Map, position As Int)
      Add a row with the given map.
      The Keys is the column name and the value is the row value
    • Add2 (addCV As ColumnValues, position As Int)
      Add a row with the given ColumnValue.
      The Keys is the column name and the value is the row value
    • Close
      Close the cursor
    • Delete (position As Int)
      Deletes the Row At The given position
    • GenerateSQLDelete As Map
      Generate SQL Delete Statements to update MYSQL DB
    • GenerateSQLInsert As Map
      Generate SQL Insert Statements to update MYSQL DB
    • GenerateSQLUpate As Map
      Generate SQL Update Statements to update MYSQL DB
    • GetAddedRows As Int[]
      Returns a list of cursor positions for Added Rows
    • GetBlob (columnName As String) As Byte[]
      Returns the Blob stored at the given column.
    • GetBlob2 (index As Int) As Byte[]
      Returns the blob stored in the column at the given ordinal.
    • GetColumnCount As Int
      Returns the number of columns in the cursor.
    • GetColumnName (Index As Int) As String
      Returns the name of the column at the specified index.
      The first column index is 0.</
    • GetColumnNames As String[]
      Returns the names of the columns in the cursor as a string array.
    • GetDeletedRows As Int[]
      Returns a list of cursor positions for Deleted Rows
    • GetDouble (columnName As String) As Double
      Returns the Double value stored in the given column.
      The value will be converted to Double if it is of a different type.
    • GetDouble2 (index As Int) As Double
      Returns the Double value stored in the column at the given ordinal.
      The value will be converted to Double if it is of a different type
    • GetEmptyMap As Map
      Convenience method to get an empty map of all the column names.
      The Keys is the column name and the values are null.
    • GetInt (columnName As String) As Int
      Returns the Int value stored in the given column.
      The value will be converted to Int if it is of a different type.
    • GetInt2 (index As Int) As Int
      Returns the Int value stored in the column at the given ordinal.
      The value will be converted to Int if it is of a different type.
    • GetLong (columnName As String) As Long
      Returns the Long value stored in the given column.
      The value will be converted to Long if it is of a different type.
    • GetLong2 (index As Int) As Long
      Returns the Long value stored in the column at the given ordinal.
      The value will be converted to Long if it is of a different type
    • GetPosition As Int
      Get the position of the cursor.
    • GetRowCount As Int
    • GetString (columnName As String) As String
      Returns the String value stored in the given column.
      The value will be converted to String if it is of a different type
    • GetString2 (index As Int) As String
      Returns the String value stored in the column at the given ordinal.
      The value will be converted to String if it is of a different type
    • GetType (index As Int) As Int
      Gets the Type For the given column index

      0 = NULL
      1 = Integer
      2 = Float
      3 = String
      4 = BLOB
    • GetUpdatedRows As Int[]
      Returns a list of cursor positions for Updated Rows
    • SetColumnUpdateCriteria (Index As Int, CriteriaMap As Map)
      Set Update criteria for the given column index
    • Update (updateMap As Map, Position As Int)
      Update row with the given map.
      The Keys are the names of the columns to update and values are the row values
    • Update2 (updateMap As ColumnValues, Position As Int)
    Properties:
    • Position As Int [write only]
 

sigster

Active Member
Licensed User
Longtime User
Hi

Thanks for this Library

I am edit database from Mysql then I need to add data to 2 Combobox
how can I kill the connection, in my mysql server it open new and new connection so open progress are to too many
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…