FORGEBOX Enterprise 🚀 - Take your ColdFusion (CFML) Development to Modern Times! Learn More...

Lucee MariaDB extension

v2.4.4 Public

Lucee MariaDB Extension

This extension installs the MariaDB Connector/J Type 4 JDBC driver for creating MariaDB data sources in Lucee Server. It is an alternative to the generic MySQL driver.

Installation

via Forgebox

  1. In your Lucee Administrator, go to the Extension > Providers page and add https://forgebox.io as a New Extension Provider if not already present
  2. Go to Extension > Applications and look for MariaDB in the "Not installed" section
  3. Click the extension and install

Manual

  1. Download the the lucee-mariadb.lex file
  2. In your Lucee Administrator, go to the Extension > Applications page
  3. Under "Upload new extension", select the lex file and click "Upload"

Usage

Once installed you can either create datasources in the Lucee Administrator using the newly added "MariaDB" type, or you can define them in your Application.cfc as follows:

this.datasource = {
	class: "org.mariadb.jdbc.Driver"
	,connectionString: "jdbc:mariadb: //[hostname]:[port]/[database]?useUnicode=true&characterEncoding=UTF-8"// and any other required parameters
	,username: [username]
	,password: [password]
	//other options if required
};

More details on defining Lucee datasources

Migration from the MySQL driver

Note that when inserting records into tables with an auto-increment primary key, the MySQL driver returns the new primary key value in two variables in the query result:

GENERATED_KEY
generatedKey

However the MariaDB driver returns the value in the following variables:

generatedKey
insert_id

Before switching drivers, you should therefore check that your code is using generatedKey and not GENERATED_KEY.

Credits

Inspiration came from Bruce Kirkpatrick.

Here are all the versions for this package. Please note that you can leverage CommandBox package versioning to install any package you like. Please refer to our managing package version guide for more information.

Version Created Last Update Published By Stable Actions
Current
2.4.4 Oct 04 2019 03:21 AM Oct 04 2019 03:21 AM
Version History
2.4.3 Aug 05 2019 11:40 AM Aug 05 2019 11:40 AM
2.4.2 Jul 05 2019 06:31 AM Jul 05 2019 06:31 AM
2.4.1 May 29 2019 06:17 AM May 30 2019 06:34 AM

 

  •   Julian Halliwell
  • Published
  • 2.4.4 is the latest of 4 release(s)
    Published
  • Published on Oct 04 2019 03:21 AM
Add https://forgebox.io to the Lucee Admin
No collaborators yet.
     
  • May 29 2019 06:17 AM
  • Oct 04 2019 03:21 AM
  • 206
  • 197
  • 171