[#7954] Document in Javadoc that JDBCUtils.dialect() and similar methods return DEFAULT, not null

This commit is contained in:
lukaseder 2018-10-19 17:47:10 +02:00
parent e6d139f682
commit 5da0b18ff5

View File

@ -114,6 +114,9 @@ public class JDBCUtils {
* the URL (e.g. when using an JDBC-ODBC bridge), further actions may be
* implemented in the future.
*
* @return The appropriate {@link SQLDialect} or {@link SQLDialect#DEFAULT}
* if no dialect could be derived from the connection. Never
* <code>null</code>.
* @see #dialect(String)
*/
public static final SQLDialect dialect(Connection connection) {
@ -270,6 +273,10 @@ public class JDBCUtils {
/**
* "Guess" the {@link SQLDialect} from a connection URL.
*
* @return The appropriate {@link SQLDialect} or {@link SQLDialect#DEFAULT}
* if no dialect could be derived from the connection. Never
* <code>null</code>.
*/
public static final SQLDialect dialect(String url) {
if (url == null)
@ -344,6 +351,10 @@ public class JDBCUtils {
/**
* "Guess" the JDBC driver from a connection URL.
*
* @return The appropriate JDBC driver class or
* <code>"java.sql.Driver"</code> if no driver class could be
* derived from the URL. Never <code>null</code>.
*/
public static final String driver(String url) {
switch (dialect(url).family()) {