Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-dev] fix for 221231: core: wrong/default JDBC Driver returns unhandled NPE instead of throwing SQLException

Everyone,
    The following eclipselink.foundation change has been checked in.
 
 
    Details:
 
A wrong driver for a DB will not throw an SQLException, it will return a null connection without an exception by design.  Our DatabaseSessionImpl.loginAndDetectDatasource() is not handling this null - it expects an SQLE which would be thrown for all other db errors such as user/pass is wrong.
Result is that the first DriverManager connect fails with an SQLException in a warning - normal, but the 2nd sql.Driver.connect() call does not fail because it returns null - it later fails with a NPE when a conn.getMetaData() call is attempted.  The user can infer the source of the NPE by looking at the DriverManager warning.
    Code Reviewed by:
        Gordon
 
    thank you
    /michael

Back to the top