Java Code Examples for java.sql.DatabaseMetaData#generatedKeyAlwaysReturned()

The following examples show how to use java.sql.DatabaseMetaData#generatedKeyAlwaysReturned() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CachedDatabaseMetaData.java    From shardingsphere with Apache License 2.0 5 votes vote down vote up
private boolean isGeneratedKeyAlwaysReturned(final DatabaseMetaData databaseMetaData) throws SQLException {
    try {
        return databaseMetaData.generatedKeyAlwaysReturned();
    } catch (final AbstractMethodError ignore) {
        return false;
    }
}
 
Example 2
Source File: CachedDatabaseMetaData.java    From shardingsphere with Apache License 2.0 5 votes vote down vote up
private boolean isGeneratedKeyAlwaysReturned(final DatabaseMetaData databaseMetaData) throws SQLException {
    try {
        return databaseMetaData.generatedKeyAlwaysReturned();
    } catch (final AbstractMethodError ignore) {
        return false;
    }
}
 
Example 3
Source File: Jdbc41Bridge.java    From Tomcat8-Source-Read with MIT License 3 votes vote down vote up
/**
 * Delegates to {@link DatabaseMetaData#generatedKeyAlwaysReturned()} without throwing a
 * {@link AbstractMethodError}.
 * <p>
 * If the JDBC driver does not implement {@link DatabaseMetaData#generatedKeyAlwaysReturned()}, then return false.
 * </p>
 *
 * @param databaseMetaData
 *            See {@link DatabaseMetaData#generatedKeyAlwaysReturned()}
 * @return See {@link DatabaseMetaData#generatedKeyAlwaysReturned()}
 * @throws SQLException
 *             See {@link DatabaseMetaData#generatedKeyAlwaysReturned()}
 * @see DatabaseMetaData#generatedKeyAlwaysReturned()
 */
public static boolean generatedKeyAlwaysReturned(final DatabaseMetaData databaseMetaData) throws SQLException {
    try {
        return databaseMetaData.generatedKeyAlwaysReturned();
    } catch (final AbstractMethodError e) {
        // do nothing
        return false;
    }
}
 
Example 4
Source File: Jdbc41Bridge.java    From commons-dbcp with Apache License 2.0 3 votes vote down vote up
/**
 * Delegates to {@link DatabaseMetaData#generatedKeyAlwaysReturned()} without throwing a
 * {@link AbstractMethodError}.
 * <p>
 * If the JDBC driver does not implement {@link DatabaseMetaData#generatedKeyAlwaysReturned()}, then return false.
 * </p>
 *
 * @param databaseMetaData
 *            See {@link DatabaseMetaData#generatedKeyAlwaysReturned()}
 * @return See {@link DatabaseMetaData#generatedKeyAlwaysReturned()}
 * @throws SQLException
 *             See {@link DatabaseMetaData#generatedKeyAlwaysReturned()}
 * @see DatabaseMetaData#generatedKeyAlwaysReturned()
 */
public static boolean generatedKeyAlwaysReturned(final DatabaseMetaData databaseMetaData) throws SQLException {
    try {
        return databaseMetaData.generatedKeyAlwaysReturned();
    } catch (final AbstractMethodError e) {
        // do nothing
        return false;
    }
}