/** * Construct a new Database Connection * * @param databaseMeta The Database Connection Info to construct the connection with. */ public Database( LoggingObjectInterface parentObject, DatabaseMeta databaseMeta ) { this.parentLoggingObject = parentObject; this.databaseMeta = databaseMeta; shareVariablesWith( databaseMeta ); if ( parentObject instanceof VariableSpace ) { shareVariablesWith( (VariableSpace) parentObject ); } log = new LogChannel( this, parentObject ); this.containerObjectId = log.getContainerObjectId(); this.logLevel = log.getLogLevel(); if ( parentObject != null ) { log.setGatheringMetrics( parentObject.isGatheringMetrics() ); } pstmt = null; rowMeta = null; dbmd = null; rowlimit = 0; written = 0; opened = copy = 0; if ( log.isDetailed() ) { log.logDetailed( "New database connection defined" ); } }
private void grabLoggingObjectInformation( LoggingObjectInterface loggingObject ) { objectType = loggingObject.getObjectType(); objectName = loggingObject.getObjectName(); repositoryDirectory = loggingObject.getRepositoryDirectory(); filename = loggingObject.getFilename(); objectId = loggingObject.getObjectId(); objectRevision = loggingObject.getObjectRevision(); objectCopy = loggingObject.getObjectCopy(); logLevel = loggingObject.getLogLevel(); containerObjectId = loggingObject.getContainerObjectId(); forcingSeparateLogging = loggingObject.isForcingSeparateLogging(); gatheringMetrics = loggingObject.isGatheringMetrics(); if ( loggingObject.getParent() != null ) { getParentLoggingObject( loggingObject.getParent() ); // inherit the containerObjectId from parent containerObjectId = loggingObject.getParent().getContainerObjectId(); } }