@ FFDCIgnore ( SQLException . class ) private Boolean supportsUnicodeStaticCheck ( DataSource ds ) { Boolean res = null ; try { Connection conn = ds . getConnection ( ) ; String product = null ; try { DatabaseMetaData dmd = conn . getMetaData ( ) ; product = dmd . getDatabaseProductName ( ) ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "supportsUnicodeStaticCheck : getDatabaseProductName = " + product ) ; } } finally { conn . close ( ) ; } for ( Pattern supportedPattern : _unicodeSupportPlatform ) { if ( supportedPattern . matcher ( product ) . matches ( ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "matched _unicodeSupportPlatform=" + supportedPattern . pattern ( ) ) ; } return Boolean . TRUE ; } } for ( Pattern unsupported : _noUnicodeSupportPlatform ) { if ( unsupported . matcher ( product ) . matches ( ) ) { if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "matched _noUnicodeSupportPlatform=" + unsupported . pattern ( ) ) ; } return Boolean . FALSE ; } } } catch ( SQLException e ) { // Unexpected if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Something went wrong in supportsUnicodeStaticCheck() -- " , e ) ; } } return res ; }
Consults the static collections contained within this class and attempts to determine whether the provided DataSource supports unicode .