类 SimpleEasyDataSource
- 所有已实现的接口:
EasyDataSource,Serializable,Wrapper,CommonDataSource,DataSource,org.springframework.beans.factory.BeanFactory,org.springframework.beans.factory.config.AutowireCapableBeanFactory,org.springframework.beans.factory.config.ConfigurableBeanFactory,org.springframework.beans.factory.config.ConfigurableListableBeanFactory,org.springframework.beans.factory.config.SingletonBeanRegistry,org.springframework.beans.factory.HierarchicalBeanFactory,org.springframework.beans.factory.InitializingBean,org.springframework.beans.factory.ListableBeanFactory,org.springframework.beans.factory.support.BeanDefinitionRegistry,org.springframework.core.AliasRegistry
- 版本:
- 1.0 describe :
- 作者:
- : Jia wei Wu
- 另请参阅:
-
字段概要
字段从类继承的字段 org.springframework.core.SimpleAliasRegistry
logger从接口继承的字段 org.springframework.beans.factory.config.AutowireCapableBeanFactory
AUTOWIRE_AUTODETECT, AUTOWIRE_BY_NAME, AUTOWIRE_BY_TYPE, AUTOWIRE_CONSTRUCTOR, AUTOWIRE_NO, ORIGINAL_INSTANCE_SUFFIX从接口继承的字段 org.springframework.beans.factory.BeanFactory
FACTORY_BEAN_PREFIX从接口继承的字段 org.springframework.beans.factory.config.ConfigurableBeanFactory
SCOPE_PROTOTYPE, SCOPE_SINGLETON -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明voidAttempts to establish a connection with the data source that thisDataSourceobject represents.getConnection(String username, String password) Attempts to establish a connection with the data source that thisDataSourceobject represents.getConnection(String url, String username, String password) intGets the maximum time in seconds that this data source can wait while attempting to connect to a database.Retrieves the log writer for thisDataSourceobject.Return the parent Logger of all the Loggers used by this data source.booleanisWrapperFor(Class<?> iface) Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.voidsetLoginTimeout(int seconds) Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.voidsetLogWriter(PrintWriter out) Sets the log writer for thisDataSourceobject to the givenjava.io.PrintWriterobject.<T> TReturns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.从类继承的方法 org.springframework.beans.factory.support.DefaultListableBeanFactory
allowAliasOverriding, checkForAliasCircle, clearMergedBeanDefinition, clearMetadataCache, containsBeanDefinition, copyConfigurationFrom, destroySingleton, destroySingletons, determineAutowireCandidate, determineHighestPriorityCandidate, determinePrimaryCandidate, doResolveDependency, findAnnotationOnBean, findAutowireCandidates, freezeConfiguration, getAutowireCandidateResolver, getBean, getBean, getBeanDefinition, getBeanDefinitionCount, getBeanDefinitionNames, getBeanNamesForAnnotation, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesForType, getBeanNamesIterator, getBeanProvider, getBeanProvider, getBeanProvider, getBeanProvider, getBeansOfType, getBeansOfType, getBeansWithAnnotation, getDependencyComparator, getPriority, getSerializationId, isAllowBeanDefinitionOverriding, isAllowEagerClassLoading, isAutowireCandidate, isAutowireCandidate, isAutowireCandidate, isBeanEligibleForMetadataCaching, isConfigurationFrozen, isPrimary, matchesBeanName, preInstantiateSingletons, registerBeanDefinition, registerResolvableDependency, registerSingleton, removeBeanDefinition, resetBeanDefinition, resolveDependency, resolveNamedBean, setAllowBeanDefinitionOverriding, setAllowEagerClassLoading, setAutowireCandidateResolver, setDependencyComparator, setSerializationId, toString, writeReplace从类继承的方法 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPostProcessorsBeforeInstantiation, applyBeanPropertyValues, applyMergedBeanDefinitionPostProcessors, applyPropertyValues, autowire, autowireBean, autowireBeanProperties, autowireByName, autowireByType, autowireConstructor, checkDependencies, clearSingletonCache, configureBean, createBean, createBean, createBean, createBeanInstance, destroyBean, determineConstructorsFromBeanPostProcessors, determineTargetType, doCreateBean, filterPropertyDescriptorsForDependencyCheck, filterPropertyDescriptorsForDependencyCheck, getEarlyBeanReference, getInstantiationStrategy, getObjectForBeanInstance, getParameterNameDiscoverer, getTypeForFactoryBean, getTypeForFactoryBean, getTypeForFactoryMethod, ignoreDependencyInterface, ignoreDependencyType, initializeBean, initializeBean, instantiateBean, instantiateUsingFactoryMethod, invokeCustomInitMethod, invokeInitMethods, isAllowCircularReferences, isAllowRawInjectionDespiteWrapping, isExcludedFromDependencyCheck, obtainFromSupplier, populateBean, postProcessObjectFromFactoryBean, predictBeanType, removeSingleton, resolveBeanByName, resolveBeforeInstantiation, resolveDependency, setAllowCircularReferences, setAllowRawInjectionDespiteWrapping, setInstantiationStrategy, setParameterNameDiscoverer, unsatisfiedNonSimpleProperties从类继承的方法 org.springframework.beans.factory.support.AbstractBeanFactory
addBeanPostProcessor, addBeanPostProcessors, addEmbeddedValueResolver, addPropertyEditorRegistrar, afterPrototypeCreation, beforePrototypeCreation, checkMergedBeanDefinition, cleanupAfterBeanCreationFailure, containsBean, containsLocalBean, copyRegisteredEditorsTo, destroyBean, destroyBean, destroyScopedBean, doGetBean, evaluateBeanDefinitionString, getAccessControlContext, getAliases, getApplicationStartup, getBean, getBean, getBean, getBean, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getBeanPostProcessors, getConversionService, getCustomEditors, getCustomTypeConverter, getMergedBeanDefinition, getMergedBeanDefinition, getMergedBeanDefinition, getMergedLocalBeanDefinition, getParentBeanFactory, getPropertyEditorRegistrars, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getType, getType, getTypeConverter, hasBeanCreationStarted, hasDestructionAwareBeanPostProcessors, hasEmbeddedValueResolver, hasInstantiationAwareBeanPostProcessors, initBeanWrapper, isActuallyInCreation, isBeanNameInUse, isCacheBeanMetadata, isFactoryBean, isFactoryBean, isPrototype, isPrototypeCurrentlyInCreation, isSingleton, isTypeMatch, isTypeMatch, isTypeMatch, markBeanAsCreated, originalBeanName, registerCustomEditor, registerCustomEditors, registerDisposableBeanIfNecessary, registerScope, removeSingletonIfCreatedForTypeCheckOnly, requiresDestruction, resolveBeanClass, resolveEmbeddedValue, setApplicationStartup, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setParentBeanFactory, setSecurityContextProvider, setTempClassLoader, setTypeConverter, transformedBeanName从类继承的方法 org.springframework.beans.factory.support.FactoryBeanRegistrySupport
getCachedObjectForFactoryBean, getFactoryBean, getObjectFromFactoryBean, getTypeForFactoryBean从类继承的方法 org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
addSingleton, addSingletonFactory, afterSingletonCreation, beforeSingletonCreation, containsSingleton, destroyBean, getDependenciesForBean, getDependentBeans, getSingleton, getSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames, hasDependentBean, isCurrentlyInCreation, isDependent, isSingletonCurrentlyInCreation, onSuppressedException, registerContainedBean, registerDependentBean, registerDisposableBean, setCurrentlyInCreation从类继承的方法 org.springframework.core.SimpleAliasRegistry
canonicalName, hasAlias, isAlias, registerAlias, removeAlias, resolveAliases从类继承的方法 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait从接口继承的方法 org.springframework.core.AliasRegistry
getAliases, isAlias, registerAlias, removeAlias从接口继承的方法 org.springframework.beans.factory.config.AutowireCapableBeanFactory
applyBeanPostProcessorsAfterInitialization, applyBeanPostProcessorsBeforeInitialization, applyBeanPropertyValues, autowire, autowireBean, autowireBeanProperties, configureBean, createBean, createBean, destroyBean, initializeBean, resolveBeanByName, resolveDependency从接口继承的方法 org.springframework.beans.factory.support.BeanDefinitionRegistry
isBeanNameInUse从接口继承的方法 org.springframework.beans.factory.BeanFactory
containsBean, getAliases, getBean, getBean, getBean, getType, getType, isPrototype, isSingleton, isTypeMatch, isTypeMatch从接口继承的方法 javax.sql.CommonDataSource
createShardingKeyBuilder从接口继承的方法 org.springframework.beans.factory.config.ConfigurableBeanFactory
addBeanPostProcessor, addEmbeddedValueResolver, addPropertyEditorRegistrar, copyRegisteredEditorsTo, destroyBean, destroyScopedBean, getAccessControlContext, getApplicationStartup, getBeanClassLoader, getBeanExpressionResolver, getBeanPostProcessorCount, getConversionService, getDependenciesForBean, getDependentBeans, getMergedBeanDefinition, getRegisteredScope, getRegisteredScopeNames, getTempClassLoader, getTypeConverter, hasEmbeddedValueResolver, isCacheBeanMetadata, isCurrentlyInCreation, isFactoryBean, registerAlias, registerCustomEditor, registerDependentBean, registerScope, resolveAliases, resolveEmbeddedValue, setApplicationStartup, setBeanClassLoader, setBeanExpressionResolver, setCacheBeanMetadata, setConversionService, setCurrentlyInCreation, setParentBeanFactory, setTempClassLoader, setTypeConverter从接口继承的方法 org.springframework.beans.factory.config.ConfigurableListableBeanFactory
ignoreDependencyInterface, ignoreDependencyType从接口继承的方法 javax.sql.DataSource
createConnectionBuilder从接口继承的方法 org.springframework.beans.factory.HierarchicalBeanFactory
containsLocalBean, getParentBeanFactory从接口继承的方法 org.springframework.beans.factory.config.SingletonBeanRegistry
containsSingleton, getSingleton, getSingletonCount, getSingletonMutex, getSingletonNames
-
字段详细资料
-
connection
-
-
构造器详细资料
-
SimpleEasyDataSource
-
-
方法详细资料
-
getConnection
Attempts to establish a connection with the data source that this
DataSourceobject represents.- 指定者:
getConnection在接口中DataSource- 返回:
- a connection to the data source
- 抛出:
SQLException- if a database access error occursSQLTimeoutException- when the driver has determined that the timeout methodName specified by thesetLoginTimeoutmethod has been exceeded and has at least tried to cancel the current database connection attempt
-
getConnection
Attempts to establish a connection with the data source that this
DataSourceobject represents.- 指定者:
getConnection在接口中DataSource- 参数:
username- the database user on whose behalf the connection is being madepassword- the user's password- 返回:
- a connection to the data source
- 抛出:
SQLException- if a database access error occursSQLTimeoutException- when the driver has determined that the timeout methodName specified by thesetLoginTimeoutmethod has been exceeded and has at least tried to cancel the current database connection attempt- 从以下版本开始:
- 1.4
-
getConnection
- 抛出:
SQLException
-
unwrap
Returns an object that implements the given interface to allow access to non-standard methods, or standard methods not exposed by the proxy.If the receiver implements the interface then the result is the receiver or a proxy for the receiver. If the receiver is a wrapper and the wrapped object implements the interface then the result is the wrapped object or a proxy for the wrapped object. Otherwise return the the result of calling
unwraprecursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then anSQLExceptionis thrown.- 指定者:
unwrap在接口中Wrapper- 参数:
iface- A Class defining an interface that the result must implement.- 返回:
- an object that implements the interface. May be a proxy for the actual implementing object.
- 抛出:
SQLException- If no object found that implements the interface- 从以下版本开始:
- 1.6
-
isWrapperFor
Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does. Returns false otherwise. If this implements the interface then return true, else if this is a wrapper then return the result of recursively callingisWrapperForon the wrapped object. If this does not implement the interface and is not a wrapper, return false. This method should be implemented as a low-cost operation compared tounwrapso that callers can use this method to avoid expensiveunwrapcalls that may fail. If this method returns true then callingunwrapwith the same argument should succeed.- 指定者:
isWrapperFor在接口中Wrapper- 参数:
iface- a Class defining an interface.- 返回:
- true if this implements the interface or directly or indirectly wraps an object that does.
- 抛出:
SQLException- if an error occurs while determining whether this is a wrapper for an object with the given interface.- 从以下版本开始:
- 1.6
-
getLogWriter
Retrieves the log writer for this
DataSourceobject.The log writer is a character output stream to which all logging and tracing messages for this data source will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source specific log writer are not printed to the log writer associated with the
java.sql.DriverManagerclass. When aDataSourceobject is created, the log writer is initially null; in other words, the default is for logging to be disabled.- 指定者:
getLogWriter在接口中CommonDataSource- 指定者:
getLogWriter在接口中DataSource- 返回:
- the log writer for this data source or null if logging is disabled
- 抛出:
SQLException- if a database access error occurs- 从以下版本开始:
- 1.4
- 另请参阅:
-
setLogWriter
Sets the log writer for this
DataSourceobject to the givenjava.io.PrintWriterobject.The log writer is a character output stream to which all logging and tracing messages for this data source will be printed. This includes messages printed by the methods of this object, messages printed by methods of other objects manufactured by this object, and so on. Messages printed to a data source- specific log writer are not printed to the log writer associated with the
java.sql.DriverManagerclass. When aDataSourceobject is created the log writer is initially null; in other words, the default is for logging to be disabled.- 指定者:
setLogWriter在接口中CommonDataSource- 指定者:
setLogWriter在接口中DataSource- 参数:
out- the new log writer; to disable logging, set to null- 抛出:
SQLException- if a database access error occurs- 从以下版本开始:
- 1.4
- 另请参阅:
-
getLoginTimeout
Gets the maximum time in seconds that this data source can wait while attempting to connect to a database. A methodName of zero means that the timeout is the default system timeout if there is one; otherwise, it means that there is no timeout. When aDataSourceobject is created, the login timeout is initially zero.- 指定者:
getLoginTimeout在接口中CommonDataSource- 指定者:
getLoginTimeout在接口中DataSource- 返回:
- the data source login time limit
- 抛出:
SQLException- if a database access error occurs.- 从以下版本开始:
- 1.4
- 另请参阅:
-
setLoginTimeout
Sets the maximum time in seconds that this data source will wait while attempting to connect to a database. A methodName of zero specifies that the timeout is the default system timeout if there is one; otherwise, it specifies that there is no timeout. When a
DataSourceobject is created, the login timeout is initially zero.- 指定者:
setLoginTimeout在接口中CommonDataSource- 指定者:
setLoginTimeout在接口中DataSource- 参数:
seconds- the data source login time limit- 抛出:
SQLException- if a database access error occurs.- 从以下版本开始:
- 1.4
- 另请参阅:
-
getParentLogger
Return the parent Logger of all the Loggers used by this data source. This should be the Logger farthest from the root Logger that is still an ancestor of all of the Loggers used by this data source. Configuring this Logger will affect all of the log messages generated by the data source. In the worst case, this may be the root Logger.- 指定者:
getParentLogger在接口中CommonDataSource- 返回:
- the parent Logger for this data source
- 抛出:
SQLFeatureNotSupportedException- if the data source does not usejava.util.logging- 从以下版本开始:
- 1.7
-
afterPropertiesSet
- 指定者:
afterPropertiesSet在接口中org.springframework.beans.factory.InitializingBean- 抛出:
Exception
-