Here you can find the source of assertNotNull(DataSource dataSource)
Parameter | Description |
---|---|
dataSource | DataSource instance |
public static void assertNotNull(DataSource dataSource)
//package com.java2s; //License from project: Open Source License import javax.sql.DataSource; import java.sql.*; public class Main { /**//from w w w. j a v a2s .c om * Throws {@link IllegalArgumentException} if provided datasource is NULL * * @param dataSource {@link DataSource} instance */ public static void assertNotNull(DataSource dataSource) { if (dataSource == null) { throw new IllegalArgumentException("Provided datasource instance is NULL, can't detect database type"); } } /** * Throws {@link IllegalArgumentException} if provided connection is NULL * * @param connection {@link Connection} instance */ public static void assertNotNull(Connection connection) { if (connection == null) { throw new IllegalArgumentException("Provided connection instance is NULL, can't detect database type"); } } }