BoxLang 🚀 A New JVM Dynamic Language Learn More...
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.
https://forgebox.io as a
New Extension Provider if not already presentOnce 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]?<parameter>=<value>"
,username: [username]
,password: [password]
//other options if required
};
More details on defining Lucee datasources
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.
The extension supports local UNIX Domain Socket connections out of
the box. This is a potentially
more performant and secure alternative to password authenticated
connections over TCP on NIX based systems where the database server is
on the same local host. Simply specify the socket path in your
datasource definition in Application.cfc:
this.datasource = {
class: "org.mariadb.jdbc.Driver"
,connectionString: "jdbc:mariadb: //localhost/[yourdatabase]?localSocket=/tmp/mariadb/mysqld.sock"
,username: [username]
,password: [password]
//other options if required
};
Replace [yourdatabase] with the name (minus brackets) of
database. To verify your database's local socket path execute the
following query: SELECT @@socket. Note that a port is not required.
Inspiration came from Bruce Kirkpatrick.
$
install F2FA5DB2-0C27-499C-B1171D2D812FDAF9
-Dlucee-extensions=F2FA5DB2-0C27-499C-B1171D2D812FDAF9