netbeans-netcat mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Efrem Mc <efrem...@gmail.com>
Subject Fwd: [jira] [Work logged] (NETBEANS-673) Add support for MariaDB JDBC driver in Add Connection dialog
Date Tue, 17 Apr 2018 23:48:48 GMT
Hi Dev:

Please let know when this is added in the code base.  I have tested it
by installing it manually and it works.

Regards,

Efrem McCrimon


---------- Forwarded message ----------
From: ASF GitHub Bot (JIRA) <jira@apache.org>
Date: Tue, Apr 17, 2018 at 2:45 PM
Subject: [jira] [Work logged] (NETBEANS-673) Add support for MariaDB
JDBC driver in Add Connection dialog
To: efremmc2@gmail.com



     [ https://issues.apache.org/jira/browse/NETBEANS-673?focusedWorklogId=91875&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-91875
]

ASF GitHub Bot logged work on NETBEANS-673:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 17/Apr/18 18:44
            Start Date: 17/Apr/18 18:44
    Worklog Time Spent: 10m
      Work Description: matthiasblaesing closed pull request #506:
[NETBEANS-673] Add support for MariaDB JDBC driver in Add Connection
wizard
URL: https://github.com/apache/incubator-netbeans/pull/506




This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/db/src/org/netbeans/modules/db/util/Bundle.properties
b/db/src/org/netbeans/modules/db/util/Bundle.properties
index 792b49bcd..c1067b45e 100644
--- a/db/src/org/netbeans/modules/db/util/Bundle.properties
+++ b/db/src/org/netbeans/modules/db/util/Bundle.properties
@@ -28,6 +28,7 @@ TYPE_Cloudscape=Cloudscape Server
 ERR_InvalidURL=Invalid URL, should be of the form \n{0}

 DRIVERNAME_MySQL=MySQL (Connector/J driver)
+DRIVERNAME_MariaDB=MariaDB (MySQL-compatible)
 DRIVERNAME_JavaDbEmbedded=Java DB (Embedded)
 DRIVERNAME_JavaDbNetwork=Java DB (Network)
 DRIVERNAME_PostgreSQL=PostgreSQL
diff --git a/db/src/org/netbeans/modules/db/util/DriverListUtil.java
b/db/src/org/netbeans/modules/db/util/DriverListUtil.java
index e11f44284..1c9279e25 100644
--- a/db/src/org/netbeans/modules/db/util/DriverListUtil.java
+++ b/db/src/org/netbeans/modules/db/util/DriverListUtil.java
@@ -223,7 +223,17 @@ private static JdbcUrl add(String name, String
driverClassName, String urlTempla
         url.setSampleUrl("jdbc:mysql://localhost:3306/mysql?zeroDateTimeBehavior=convertToNull");
         url.setSampleUser("root");
         url.setSamplePassword("");
-
+
+        url = add(NbBundle.getMessage(DriverListUtil.class,
"DRIVERNAME_MariaDB"),
+                "org.mariadb.jdbc.Driver",
+
"jdbc:mariadb://[<HOST>[:<PORT>]][/<DB>][?<ADDITIONAL>]", true); //
NOI18N
+        /* The zeroDateTimeBehavior property is not supported by the
MariaDB driver, so drop it from
+        the sample URL ( https://jira.mariadb.org/browse/CONJ-204 ).
The system database seems to
+        still be called "mysql" (
https://mariadb.com/kb/en/library/the-mysql-database-tables ). */
+        url.setSampleUrl("jdbc:mariadb://localhost:3306/mysql");
+        url.setSampleUser("root");
+        url.setSamplePassword("");
+
         add("MySQL (MM.MySQL driver)",
         "org.gjt.mm.mysql.Driver",
         "jdbc:mysql://<HOST>[:<PORT>]/<DB>");
diff --git a/db/test/unit/src/org/netbeans/modules/db/util/DriverListUtilTest.java
b/db/test/unit/src/org/netbeans/modules/db/util/DriverListUtilTest.java
index e1ea17c61..61cc7b24d 100644
--- a/db/test/unit/src/org/netbeans/modules/db/util/DriverListUtilTest.java
+++ b/db/test/unit/src/org/netbeans/modules/db/util/DriverListUtilTest.java
@@ -207,6 +207,26 @@ public void testMySQL() throws Exception {
         propValues.remove(JdbcUrl.TOKEN_HOST);
         testUrlString(url, propValues, "jdbc:mysql:///" + DB);
     }
+
+    public void testMariaDB() throws Exception {
+        ArrayList<String> requiredProps = new ArrayList<String>();
+        JdbcUrl url = checkUrl(getDriverName("DRIVERNAME_MariaDB"),
null, "org.mariadb.jdbc.Driver",
+                "jdbc:mariadb://[<HOST>[:<PORT>]][/<DB>][?<ADDITIONAL>]",
+                STD_SUPPORTED_PROPS, requiredProps);
+
+        HashMap<String, String> propValues =
buildPropValues(STD_SUPPORTED_PROPS);
+
+        testUrlString(url, propValues, "jdbc:mariadb://" + HOST + ":"
+ PORT + "/" + DB + "?" + ADDITIONAL);
+
+        propValues.remove(JdbcUrl.TOKEN_ADDITIONAL);
+        testUrlString(url, propValues, "jdbc:mariadb://" + HOST + ":"
+ PORT + "/" + DB);
+
+        propValues.remove(JdbcUrl.TOKEN_PORT);
+        testUrlString(url, propValues, "jdbc:mariadb://" + HOST + "/" + DB);
+
+        propValues.remove(JdbcUrl.TOKEN_HOST);
+        testUrlString(url, propValues, "jdbc:mariadb:///" + DB);
+    }

     enum DB2Types { DB2, IDS, CLOUDSCAPE };





----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 91875)
    Time Spent: 50m  (was: 40m)

> Add support for MariaDB JDBC driver in Add Connection dialog
> ------------------------------------------------------------
>
>                 Key: NETBEANS-673
>                 URL: https://issues.apache.org/jira/browse/NETBEANS-673
>             Project: NetBeans
>          Issue Type: Bug
>          Components: db - Code
>    Affects Versions: 9.0
>            Reporter: Eirik Bakke
>            Priority: Minor
>              Labels: pull-request-available
>         Attachments: NETBEANS-673 Patch Screenshot Updated.png
>
>          Time Spent: 50m
>  Remaining Estimate: 0h
>
> The "Add Connection" wizard does not currently recognize the MariaDB JDBC driver; this
means that the "host", "port", and "database" fields do not end up being shown in the connection
panel. Instead, the user has to manually construct the JDBC URL to insert this information.
> The fix is simple; a new entry needs to be added in org.netbeans.modules.db.util.DriverListUtil
, recognizing the driver class "org.mariadb.jdbc.Driver" (instead of "com.mysql.jdbc.Driver"
for MySQL). The MariaDB driver uses the exact same format for its JDBC URLs as MySQL, except
allows the protocol name "mariadb" to be used instead of "mysql".
> (MariaDB and its driver aims to be completely compatible with MySQL--either driver can
be used to connect to either database. The MariaDB JDBC driver is LGPL while MySQL's driver
is GPL, however, making only the MariaDB one suitable for bundling with commercial software.)
> See also https://issues.apache.org/jira/browse/NETBEANS-170, which deals with simplifying
the JDBC driver download process.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: netcat-unsubscribe@netbeans.apache.org
For additional commands, e-mail: netcat-help@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists


Mime
View raw message