Lucee doesn't correctly handle wrong JDBC connection string, causing NPE

Description

I found this on accident when I manually declared a datasource connection that used the JTDS driver but accidentally used the Microsoft JDBC connection string:

The error was a null pointer exception which was unhelpful and difficult to track down.

If you look at the docs, you'll find this:
https://docs.oracle.com/javase/7/docs/api/java/sql/Driver.html#connect(java.lang.String,%20java.util.Properties)

The driver should return "null" if it realizes it is the wrong kind of driver to connect to the given URL.

Lucee does not account for getting null back when asking the driver to connect. Lucee needs to check for a null value back and throw an exception that explains that the driver has rejected the connection string. Here is the line of code in Lucee that needs to be doing this check:

https://github.com/lucee/Lucee/blob/master/core/src/main/java/lucee/runtime/db/DataSourceSupport.java#L111

Environment

None

Assignee

Pothys - MitrahSoft

Reporter

Brad Wood

Priority

New

Labels

None

Fix versions

None
Configure