if (ConnectionFactory.class.isInstance(cf)) { final Connection connection = ConnectionFactory.class.cast(cf).getConnection(); connection.getMetaData(); connection.close();
if (cf instanceof ConnectionFactory) { final Connection connection = ((ConnectionFactory) cf).getConnection(); connection.getMetaData(); connection.close();
/** * If logging is turned on and the CCI implementation supports meta data then display connection info. */ protected void buildConnectLog(AbstractSession session) { try { // Log connection information. if (session.shouldLog(SessionLog.CONFIG, SessionLog.CONNECTION)) {// Avoid printing if no logging required. ConnectionMetaData metaData = getCCIConnection().getMetaData(); Object[] args = { metaData.getUserName(), metaData.getEISProductName(), metaData.getEISProductVersion(), Helper.cr(), "\t" }; session.log(SessionLog.CONFIG, SessionLog.CONNECTION, "connected_user_database", args, this); } } catch (ResourceException exception) { // Some databases do not support metadata, ignore exception. session.warning("JDBC_driver_does_not_support_meta_data", SessionLog.CONNECTION); } }
/** * If logging is turned on and the CCI implementation supports meta data then display connection info. */ protected void buildConnectLog(AbstractSession session) { try { // Log connection information. if (session.shouldLog(SessionLog.CONFIG, SessionLog.CONNECTION)) {// Avoid printing if no logging required. ConnectionMetaData metaData = getCCIConnection().getMetaData(); Object[] args = { metaData.getUserName(), metaData.getEISProductName(), metaData.getEISProductVersion(), Helper.cr(), "\t" }; session.log(SessionLog.CONFIG, SessionLog.CONNECTION, "connected_user_database", args, this); } } catch (ResourceException exception) { // Some databases do not support metadata, ignore exception. session.warning("JDBC_driver_does_not_support_meta_data", SessionLog.CONNECTION); } }
/** * If logging is turned on and the CCI implementation supports meta data then display connection info. */ @Override protected void buildConnectLog(AbstractSession session) { try { // Log connection information. if (session.shouldLog(SessionLog.CONFIG, SessionLog.CONNECTION)) {// Avoid printing if no logging required. ConnectionMetaData metaData = getCCIConnection().getMetaData(); Object[] args = { metaData.getUserName(), metaData.getEISProductName(), metaData.getEISProductVersion(), Helper.cr(), "\t" }; session.log(SessionLog.CONFIG, SessionLog.CONNECTION, "connected_user_database", args, this); } } catch (ResourceException exception) { // Some databases do not support metadata, ignore exception. session.warning("JDBC_driver_does_not_support_meta_data", SessionLog.CONNECTION); } }