类 SimpleEasyDataSource

java.lang.Object
org.springframework.core.SimpleAliasRegistry
org.springframework.beans.factory.support.DefaultSingletonBeanRegistry
org.springframework.beans.factory.support.FactoryBeanRegistrySupport
org.springframework.beans.factory.support.AbstractBeanFactory
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory
org.springframework.beans.factory.support.DefaultListableBeanFactory
com.wu.framework.inner.database.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

@Order(-2147483648) @AutoConfigureAfter(name="com.wu.framework.inner.database.config.SimpleCustomDatabaseConfiguration") @ConditionalOnBean(value=ICustomDatabaseConfiguration.class, name="simpleCustomDatabaseConfiguration") @Configuration("simpleEasyDataSource") public class SimpleEasyDataSource extends org.springframework.beans.factory.support.DefaultListableBeanFactory implements EasyDataSource, org.springframework.beans.factory.InitializingBean
版本:
1.0 describe :
作者:
: Jia wei Wu
另请参阅:
  • 字段概要

    字段
    修饰符和类型
    字段
    说明
    protected Connection
     

    从类继承的字段 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
  • 构造器概要

    构造器
    构造器
    说明
    SimpleEasyDataSource(ICustomDatabaseConfiguration iCustomDatabaseConfiguration)
     
  • 方法概要

    修饰符和类型
    方法
    说明
    void
     
    Attempts to establish a connection with the data source that this DataSource object represents.
    getConnection(String username, String password)
    Attempts to establish a connection with the data source that this DataSource object represents.
    getConnection(String url, String username, String password)
     
    int
    Gets the maximum time in seconds that this data source can wait while attempting to connect to a database.
    Retrieves the log writer for this DataSource object.
    Return the parent Logger of all the Loggers used by this data source.
    boolean
    isWrapperFor(Class<?> iface)
    Returns true if this either implements the interface argument or is directly or indirectly a wrapper for an object that does.
    void
    setLoginTimeout(int seconds)
    Sets the maximum time in seconds that this data source will wait while attempting to connect to a database.
    void
    Sets the log writer for this DataSource object to the given java.io.PrintWriter object.
    <T> T
    unwrap(Class<T> iface)
    Returns 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
  • 字段详细资料

  • 构造器详细资料

  • 方法详细资料

    • getConnection

      public Connection getConnection() throws SQLException

      Attempts to establish a connection with the data source that this DataSource object represents.

      指定者:
      getConnection 在接口中 DataSource
      返回:
      a connection to the data source
      抛出:
      SQLException - if a database access error occurs
      SQLTimeoutException - when the driver has determined that the timeout methodName specified by the setLoginTimeout method has been exceeded and has at least tried to cancel the current database connection attempt
    • getConnection

      public Connection getConnection(String username, String password) throws SQLException

      Attempts to establish a connection with the data source that this DataSource object represents.

      指定者:
      getConnection 在接口中 DataSource
      参数:
      username - the database user on whose behalf the connection is being made
      password - the user's password
      返回:
      a connection to the data source
      抛出:
      SQLException - if a database access error occurs
      SQLTimeoutException - when the driver has determined that the timeout methodName specified by the setLoginTimeout method has been exceeded and has at least tried to cancel the current database connection attempt
      从以下版本开始:
      1.4
    • getConnection

      public Connection getConnection(String url, String username, String password) throws SQLException
      抛出:
      SQLException
    • unwrap

      public <T> T unwrap(Class<T> iface) throws SQLException
      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 unwrap recursively on the wrapped object or a proxy for that result. If the receiver is not a wrapper and does not implement the interface, then an SQLException is 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

      public boolean isWrapperFor(Class<?> iface) throws SQLException
      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 calling isWrapperFor on 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 to unwrap so that callers can use this method to avoid expensive unwrap calls that may fail. If this method returns true then calling unwrap with 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

      public PrintWriter getLogWriter() throws SQLException

      Retrieves the log writer for this DataSource object.

      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.DriverManager class. When a DataSource object 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

      public void setLogWriter(PrintWriter out) throws SQLException

      Sets the log writer for this DataSource object to the given java.io.PrintWriter object.

      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.DriverManager class. When a DataSource object 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

      public int getLoginTimeout() throws SQLException
      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 a DataSource object 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

      public void setLoginTimeout(int seconds) throws SQLException

      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 DataSource object 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

      public Logger getParentLogger() throws SQLFeatureNotSupportedException
      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 use java.util.logging
      从以下版本开始:
      1.7
    • afterPropertiesSet

      public void afterPropertiesSet() throws Exception
      指定者:
      afterPropertiesSet 在接口中 org.springframework.beans.factory.InitializingBean
      抛出:
      Exception