Package com.iizix.db.prop
Class ConnectionProfileSetup
- All Implemented Interfaces:
- EventListener,- IGProp<GProp<?>[]>,- IPropCnr,- Cloneable
- Direct Known Subclasses:
- EditorConnectionProfileSetup
A single connection profile setup that is used to establish a JDBC connection.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final intThe default pool size: 100.- static final intThe default pool timeout in milliseconds: 10,000 ms (10 seconds).- static final intThe default connection validity timeout in milliseconds: 1000 ms (1 seconds).- static final StringPredefined property name: classpath as list of Jar's (e.g.- static final StringPredefined property name: database name (e.g.- static final StringPredefined property name: JDBC driver class name, (e.g.- static final StringPredefined property name: driver definition ID in Eclipse DTP connection profiles (e.g.- static final String[]Names that are placed as StringProp's instead of placed into the Properties StringMapProp.- static final StringPredefined property name: password (this property is not a StringProp but a PasswordProp!)- static final StringPredefined property name: pool size (this property is not a StringProp but a IntProp!)- static final StringPredefined property name: pool timeout (this property is not a StringProp but a IntProp!)- static final StringPredefined property name: URL to database (e.g.- static final StringPredefined property name: user name.- static final StringPredefined property name: connection valid timeout (this property is not a StringProp but a IntProp!)- static final StringPredefined property name: vendor (e.g.- static final StringPredefined property name: version of driver (e.g.- Fields inherited from class com.iizix.prop.PropCnr- EMPTY, EMPTY_CLASSES, EMPTY_CNRS, EXTENDS_FRAMEWORK_ERROR_ID- Fields inherited from class com.iizix.prop.GProp- GPDEBUG, PROP_ATTR_STRING_EDITOR_PROP, PROP_ATTR_STRING_ERRORED_NAME, PROP_ATTR_STRING_EXTENDS, PROP_ATTR_STRING_EXTENDS_FINAL, PROP_ATTR_STRING_EXTENDS_PRIVATE, PROP_ATTR_STRING_NULLABLE, PROP_ATTR_STRING_PRIVATE, PROP_ATTR_STRING_PRIVATE_CHANGE_EVENT, PROP_ATTR_STRING_READ_ONLY, PROP_USER_1, PROP_USER_2- Fields inherited from interface com.iizix.prop.IGProp- EQC_ERROR_IGNORE_ALL, EQC_ERROR_IGNORE_REFERENCES, EQC_IGNORE_ARRAY, EQC_IGNORE_VOLATILE_OR_EDITOR, EQC_INCLUDE_PRIVATE, EQC_SAVE_FILE, EXT_CONTAINER_EXTENDS, EXT_CONTAINER_EXTENDS_VALID, EXT_EXTENDED, EXT_FINAL, EXT_OVERRIDES, EXT_OVERRIDES_FINAL_ERR, EXT_PRIVATE
- Constructor SummaryConstructorsConstructorDescriptionConstructs the connection profile setup container without name.- ConnectionProfileSetup- (Atom name) Constructs the connection profile setup container with specified name.
- Method SummaryModifier and TypeMethodDescription- clone()Clones the instance.Creates the Driver specific Properties.- booleanGets the auto-commit mode.Gets a new connection from the pool.Gets the connection pool to retrieve a new connection.- getName()Gets the name of the profile.- intGets the transaction isolation level.- booleanVerification if two connection profiles are equal in terms of the JDBC Driver information.- protected voidDisposes of the connection pool if allocated without closing current connections.- void- setFromEclipseBase- (Properties props) Stores the information from Eclipse connection profile base Properties.- booleanSets the name of the profile.- Methods inherited from class com.iizix.prop.PropCnr- __transferChildProps, addPredefinedProps, addProp, addProp, addProp2, addProp2, appendPropValue, canRequestFocus, completeVirtualize, containsProp, containsProp, convertLoadedProp, couldRequestFocusIfVirtualized, createCopyOfAtom, createUniqueAtom, createUniqueAtom, createUniqueAtom, createVSReference, doPropEqualsArrayValues, enablePropCommunication, enablePropHashMap, equalsTree, equalsTree, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getAllProps, getBool, getBool, getBool, getBool, getChildPropError, getChildPropError, getChildPropErrorSeverity, getChildPropErrorSeverity, getErrorsProp, getExtendsContainer, getExtendsError, getExtendsName, getExtendsOverride, getExtendsPossibleClasses, getFirstProp, getFirstProp, getFocusEngine, getInt, getInt, getInt, getInt, getLong, getLong, getLong, getLong, getNumber, getNumber, getNumber, getNumber, getPossibleChildren, getPredefinedProps, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getProp, getPropBaseReference, getPropCnr, getPropCount, getPropCount, getPropIndex, getPropIndex, getPropIndexes, getProps, getProps, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue, getPropValue0, getRetargetedVerifyContainer, getString, getString, getString, getString, getValueClasses, getVSReference, hasFocus, hasSendData, initializeElement, initializeExtendsFramework, initializeProp, initializeValue, initPropCnr, insertProp, insertProp2, isChild, isExtendsOverriden, isExtendsPropertyValid, isExtendsRoot, isPropAddRemoveAllowed, isPropCommunicating, isPropExtended, list, list, logPropNotFound, maybeAddProp, onInsertProp, onPropRemoved, onPropTreeInitialized, onReferenceEvent, onVirtualContainerCreated, onVirtualizationCompleted, paramString, prepare, removeAllProps, removeAllProps2, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, removeProp2, reorderProps, replaceProps, requestFocus, requestFocus, requestFocusEx, requestFocusEx, resolveReferences, resolveRuntimeReferences, setBool, setBool, setBool, setBool, setCreateRequiredProp, setExtendsName, setExtendsOverride, setInt, setInt, setInt, setLong, setLong, setLong, setLong, setNumber, setNumber, setNumber, setNumber, setProp, setProp, setProp, setProp2, setProp2, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setPropValue, setString, setString, setString, setString, shouldCreateProps, shouldSerializeToXML, toElementString, toNativeValue0, usePropHashMap, usesPropIndex, validateChildPropInValue, validateClassInstances, validatePropType, validatePropValue, verify, verifyInternalUseOnly, verifyTree, virtualize- Methods inherited from class com.iizix.prop.GProp- addPropError, addPropListener, appendProp, convertPropError, dispose, equals, equals, equalsErrors, equalsObj, equalsPropValue, equalValues, finalize, fine, fine, finer, finer, finest, finest, fromElementString, getAliasName, getAppSessionGyro, getAppWorker, getAtomPath, getAttribute, getChildReferencePropName, getClientSessionGyro, getClientWorker, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropName, getFullPropNameDebug, getFullPropNameDebug, getListeners, getModuleFolder, getModuleFolder, getParent, getParent, getProjectName, getPropAtom, getPropError, getPropError, getPropErroredName, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromPath, getPropFromReference, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropReferenceTarget, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getPropValueObject, getReferencePropName, getReferencePropNameNoAssert, getRelativePropName, getRootFromName, getRootName, getRootParent, getRootParentNoAssert, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropForEditor, isPropNullable, isPropPrivate, isPropPrivateAtCreation, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropRootLoading, isPropRootTreeModificationsAllowed, isPropUSER, isPropValueTreeLockNeeded, isPropVirtualized, isPropVirtualizing, isPropVolatile, isPropVolatileOrEditorOnly, isProxied, isSibling, list, list, list, mapAliasToReference, mapAliasToReference, mapReferenceToAlias, mapReferenceToAlias, mapReferenceToProjectRelative, modifyPropValue, moveProp, moveProp, moveProp, onEvent, onEventSelf, onPrepare, onPropInvalidateCache, onPropParentChanged, onPropValueSet, onRemoteEvent, paramString, paramValue, post, post, removePropError, removePropListener, removePropUSER, renameProp, renameProp2, resetChangedTree, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPrivateCreateRequiredProp, setPropError, setPropErroredName, setPropExtended, setPropExtendsFinal, setPropExtendsPrivate, setPropForEditor, setPropNullable, setPropPrivate, setPropReadOnly, setPropUSER, setPropValue, setPropValue, setPropValue, setPropValueIncognito, setPropVolatile, severe, severe, severe, shouldSerializeToXML, throwIfReadOnly, toNativeValue, toString, toString, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning- Methods inherited from class java.lang.Object- getClass, hashCode, notify, notifyAll, wait, wait, wait- Methods inherited from interface com.iizix.prop.IGProp- addPropError, addPropListener, dispose, equals, fine, fine, finer, finer, finest, finest, fromElementString, getAppSessionGyro, getAtomPath, getClientSessionGyro, getConstraints, getEnvironment, getErroredPropItems, getErroredProps, getErrorsProp, getExtendsRootContainer, getFullPropName, getFullPropNameDebug, getModuleFolder, getModuleFolder, getParent, getParent, getPropAtom, getPropError, getPropError, getPropErrorSeverity, getPropExtendsFlags, getPropFromPath, getPropFromReference, getPropIndex, getPropName, getPropPath, getPropPath, getPropRootPropMgr, getPropTreeErrorSeverity, getPropValue, getPropValue, getReferencePropName, getRelativePropName, getRootParent, getTreeLock, hasChanged, hasCircularReferencesError, hasPrivateChangeEventProp, hasPropError, hasPropTreeError, info, info, initializeGElement, initializeGProp, isDisposed, isPropChildOf, isPropClientCreated, isPropCreateRequired, isPropExtended, isPropExtendsFinal, isPropExtendsPrivate, isPropExtendsPrivateInRoot, isPropExtendsPrivateInRoot, isPropFile, isPropFolder, isPropNullable, isPropPrivate, isPropReadOnly, isPropReferenceTreeValid, isPropRoot, isPropVirtualized, isSibling, list, list, list, mapAliasToReference, mapReferenceToAlias, mapReferenceToProjectRelative, moveProp, moveProp, moveProp, onEvent, onEventSelf, onRemoteEvent, removePropError, removePropListener, renameProp, setChanged, setConstraints, setConstraints, setParent, setPrivateChangeEventProp, setPropError, setPropExtendsFinal, setPropExtendsPrivate, setPropNullable, setPropPrivate, setPropReadOnly, setPropValue, setPropValue, severe, severe, severe, toNativeValue, triggerRemoteEvent, triggerRemoteEvent, validateProp, warning, warning, warning- Methods inherited from interface com.iizix.prop.IPropCnr- canRequestFocus, canRequestFocus, couldRequestFocusIfVirtualized, couldRequestFocusIfVirtualized
- Field Details- PROP_VENDORPredefined property name: vendor (e.g. "Derby").- See Also:
 
- PROP_VERSIONPredefined property name: version of driver (e.g. "10.2").- See Also:
 
- PROP_DRIVER_DEFINITION_IDPredefined property name: driver definition ID in Eclipse DTP connection profiles (e.g. "DriverDefn.org.eclipse.birt.report.data.oda.jdbc.dbprofile.sampledb.driverTemplate.BIRT SampleDb Derby Embedded Driver").- See Also:
 
- PROP_CLASSPATHPredefined property name: classpath as list of Jar's (e.g. "C:\Eclipse\64\eclipsename\plugins\org.apache.derby.core_v.er.si.on_vDATEtime\derby.jar"), separated by comma's. Duplicate comma's mean a single one!- See Also:
 
- PROP_DRIVER_CLASSPredefined property name: JDBC driver class name, (e.g. "org.apache.derby.jdbc.EmbeddedDriver").- See Also:
 
- PROP_DATABASE_NAMEPredefined property name: database name (e.g. "BirtSample").- See Also:
 
- PROP_URLPredefined property name: URL to database (e.g. "jdbc:derby:C:\iizi\runtime\.metadata\.plugins\org.eclipse.birt.report.data.oda.jdbc.dbprofile.sampledb/db/BirtSample").- See Also:
 
- PROP_USERNAMEPredefined property name: user name.- See Also:
 
- PROP_PASSWORDPredefined property name: password (this property is not a StringProp but a PasswordProp!)- See Also:
 
- PROP_POOL_SIZEPredefined property name: pool size (this property is not a StringProp but a IntProp!)- See Also:
 
- PROP_POOL_TIMEOUTPredefined property name: pool timeout (this property is not a StringProp but a IntProp!)- See Also:
 
- PROP_VALID_TIMEOUTPredefined property name: connection valid timeout (this property is not a StringProp but a IntProp!)- See Also:
 
- DEFAULT_POOL_SIZEpublic static final int DEFAULT_POOL_SIZEThe default pool size: 100.- See Also:
 
- DEFAULT_POOL_TIMEOUTpublic static final int DEFAULT_POOL_TIMEOUTThe default pool timeout in milliseconds: 10,000 ms (10 seconds).- See Also:
 
- DEFAULT_VALID_TIMEOUTpublic static final int DEFAULT_VALID_TIMEOUTThe default connection validity timeout in milliseconds: 1000 ms (1 seconds).- See Also:
 
- PROP_LISTNames that are placed as StringProp's instead of placed into the Properties StringMapProp.
 
- Constructor Details- ConnectionProfileSetuppublic ConnectionProfileSetup()Constructs the connection profile setup container without name.
- ConnectionProfileSetupConstructs the connection profile setup container with specified name.- Parameters:
- name- The name.
 
 
- Method Details- cloneClones the instance.
- onPropDisposeprotected void onPropDispose()Disposes of the connection pool if allocated without closing current connections.- Overrides:
- onPropDisposein class- PropCnr
 
- getNameGets the name of the profile.- Returns:
- The profile name, or "<undefined>" if not defined.
 
- setNameSets the name of the profile.- Parameters:
- name- The name of the profile.
- Returns:
- true when this property container has been changed, false otherwise (or for error).
 
- setFromEclipseBaseStores the information from Eclipse connection profile base Properties.- Parameters:
- props- The Properties.
 
- createDriverPropertiesCreates the Driver specific Properties.- Returns:
- A new Properties instance with at least "user" and "password" set.
 
- isJDBCDriverEqualVerification if two connection profiles are equal in terms of the JDBC Driver information. The Properties are checked for equality, excluding the connection profile name and other settings that are not used in the JDBC Driver construction.- Parameters:
- setup- Another connection profile setup to check for "equality".
- Returns:
- true if it would result in the same JDBC Driver setup, false otherwise.
 
- getConnectionPoolGets the connection pool to retrieve a new connection. This is called when the DB TXP node is created. Normally the pool should have been created, otherwise log a warning.- Returns:
- The connection pool.
- Throws:
- ActionActorException- If there is a problem such as connection profiles disposed of or failure to initialize the pool.
 
- getTransactionIsolationLevelpublic int getTransactionIsolationLevel()Gets the transaction isolation level.- Returns:
- The level is one of the following Connectionconstants:Connection.TRANSACTION_READ_UNCOMMITTED,Connection.TRANSACTION_READ_COMMITTED(default if value is undefined),Connection.TRANSACTION_REPEATABLE_READ, orConnection.TRANSACTION_SERIALIZABLE.
 
- getAutoCommitpublic boolean getAutoCommit()Gets the auto-commit mode.- Returns:
- true for auto-commit mode (default), false for manual commit.
 
- getConnectionGets a new connection from the pool.- Returns:
- The connection, initialized with the auto-commit mode of the connection profile and transaction isolation level (if JDBC driver supports it).
- Throws:
- SQLException- If the pool is closed or found a connection that was closed or invalid and needed to recreate a connection because the pool was exhausted.