Save This Page
Home » MySQL-JDBC-5.1.11 » com.mysql.jdbc.jdbc2.optional » [javadoc | source]
com.mysql.jdbc.jdbc2.optional
public class: MysqlDataSource [javadoc | source]
java.lang.Object
   com.mysql.jdbc.ConnectionPropertiesImpl
      com.mysql.jdbc.jdbc2.optional.MysqlDataSource

All Implemented Interfaces:
    DataSource, Referenceable, Serializable, ConnectionProperties

Direct Known Subclasses:
    MysqlConnectionPoolDataSource, MysqlXADataSource

A JNDI DataSource for a Mysql JDBC connection
Field Summary
protected static  NonRegisteringDriver mysqlDriver    The driver to create connections with 
protected  PrintWriter logWriter    Log stream 
protected  String databaseName    Database Name 
protected  String encoding    Character Encoding 
protected  String hostName    Hostname 
protected  String password    Password 
protected  String profileSql    The profileSql property 
protected  String url    The JDBC URL 
protected  String user    User name 
protected  boolean explicitUrl    Should we construct the URL, or has it been set explicitly 
protected  int port    Port number 
Fields inherited from com.mysql.jdbc.ConnectionPropertiesImpl:
ZERO_DATETIME_BEHAVIOR_CONVERT_TO_NULL,  ZERO_DATETIME_BEHAVIOR_EXCEPTION,  ZERO_DATETIME_BEHAVIOR_ROUND,  largeRowSizeThreshold
Constructor:
 public MysqlDataSource() 
Method from com.mysql.jdbc.jdbc2.optional.MysqlDataSource Summary:
getConnection,   getConnection,   getConnection,   getDatabaseName,   getLogWriter,   getLoginTimeout,   getPort,   getPortNumber,   getReference,   getServerName,   getURL,   getUrl,   getUser,   setDatabaseName,   setLogWriter,   setLoginTimeout,   setPassword,   setPort,   setPortNumber,   setPropertiesViaRef,   setServerName,   setURL,   setUrl,   setUser
Methods from com.mysql.jdbc.ConnectionPropertiesImpl:
exposeAsDriverPropertyInfo,   exposeAsDriverPropertyInfoInternal,   exposeAsProperties,   exposeAsXml,   getAllowLoadLocalInfile,   getAllowMultiQueries,   getAllowNanAndInf,   getAllowUrlInLocalInfile,   getAlwaysSendSetIsolation,   getAutoClosePStmtStreams,   getAutoDeserialize,   getAutoGenerateTestcaseScript,   getAutoReconnectForPools,   getAutoSlowLog,   getBlobSendChunkSize,   getBlobsAreStrings,   getCacheCallableStatements,   getCacheCallableStmts,   getCachePrepStmts,   getCachePreparedStatements,   getCacheResultSetMetadata,   getCacheServerConfiguration,   getCallableStatementCacheSize,   getCallableStmtCacheSize,   getCapitalizeTypeNames,   getCharacterSetResults,   getClientCertificateKeyStorePassword,   getClientCertificateKeyStoreType,   getClientCertificateKeyStoreUrl,   getClientInfoProvider,   getClobCharacterEncoding,   getClobberStreamingResults,   getCompensateOnDuplicateKeyUpdateCounts,   getConnectTimeout,   getConnectionCollation,   getConnectionLifecycleInterceptors,   getContinueBatchOnError,   getCreateDatabaseIfNotExist,   getDefaultFetchSize,   getDontTrackOpenResources,   getDumpMetadataOnColumnNotFound,   getDumpQueriesOnException,   getDynamicCalendars,   getElideSetAutoCommits,   getEmptyStringsConvertToZero,   getEmulateLocators,   getEmulateUnsupportedPstmts,   getEnablePacketDebug,   getEnableQueryTimeouts,   getEncoding,   getExceptionInterceptor,   getExceptionInterceptors,   getExplainSlowQueries,   getFailOverReadOnly,   getFunctionsNeverReturnBlobs,   getGatherPerfMetrics,   getGatherPerformanceMetrics,   getGenerateSimpleParameterMetadata,   getHighAvailability,   getHoldResultsOpenOverStatementClose,   getIgnoreNonTxTables,   getIncludeInnodbStatusInDeadlockExceptions,   getInitialTimeout,   getInteractiveClient,   getIsInteractiveClient,   getJdbcCompliantTruncation,   getJdbcCompliantTruncationForReads,   getLargeRowSizeThreshold,   getLoadBalanceBlacklistTimeout,   getLoadBalanceStrategy,   getLocalSocketAddress,   getLocatorFetchBufferSize,   getLogSlowQueries,   getLogXaCommands,   getLogger,   getLoggerClassName,   getMaintainTimeStats,   getMaxAllowedPacket,   getMaxQuerySizeToLog,   getMaxReconnects,   getMaxRows,   getMetadataCacheSize,   getNetTimeoutForStreamingResults,   getNoAccessToProcedureBodies,   getNoDatetimeStringSync,   getNoTimezoneConversionForTimeType,   getNullCatalogMeansCurrent,   getNullNamePatternMatchesAll,   getOverrideSupportsIntegrityEnhancementFacility,   getPacketDebugBufferSize,   getPadCharsWithSpace,   getParanoid,   getPasswordCharacterEncoding,   getPedantic,   getPinGlobalTxToPhysicalConnection,   getPopulateInsertRowWithDefaultValues,   getPrepStmtCacheSize,   getPrepStmtCacheSqlLimit,   getPreparedStatementCacheSize,   getPreparedStatementCacheSqlLimit,   getProcessEscapeCodesForPrepStmts,   getProfileSQL,   getProfileSql,   getProfilerEventHandler,   getPropertiesTransform,   getQueriesBeforeRetryMaster,   getQueryTimeoutKillsConnection,   getReconnectAtTxEnd,   getRelaxAutoCommit,   getReportMetricsIntervalMillis,   getRequireSSL,   getResourceId,   getResultSetSizeThreshold,   getRetainStatementAfterResultSetClose,   getRetriesAllDown,   getRewriteBatchedStatements,   getRollbackOnPooledClose,   getRoundRobinLoadBalance,   getRunningCTS13,   getSecondsBeforeRetryMaster,   getSelfDestructOnPingMaxOperations,   getSelfDestructOnPingSecondsLifetime,   getServerTimezone,   getSessionVariables,   getSlowQueryThresholdMillis,   getSlowQueryThresholdNanos,   getSocketFactory,   getSocketFactoryClassName,   getSocketTimeout,   getStatementInterceptors,   getStrictFloatingPoint,   getStrictUpdates,   getTcpKeepAlive,   getTcpNoDelay,   getTcpRcvBuf,   getTcpSndBuf,   getTcpTrafficClass,   getTinyInt1isBit,   getTraceProtocol,   getTransformedBitIsBoolean,   getTreatUtilDateAsTimestamp,   getTrustCertificateKeyStorePassword,   getTrustCertificateKeyStoreType,   getTrustCertificateKeyStoreUrl,   getUltraDevHack,   getUseAffectedRows,   getUseBlobToStoreUTF8OutsideBMP,   getUseColumnNamesInFindColumn,   getUseCompression,   getUseConfigs,   getUseCursorFetch,   getUseDirectRowUnpack,   getUseDynamicCharsetInfo,   getUseFastDateParsing,   getUseFastIntParsing,   getUseGmtMillisForDatetimes,   getUseHostsInPrivileges,   getUseInformationSchema,   getUseJDBCCompliantTimezoneShift,   getUseJvmCharsetConverters,   getUseLegacyDatetimeCode,   getUseLocalSessionState,   getUseLocalTransactionState,   getUseNanosForElapsedTime,   getUseOldAliasMetadataBehavior,   getUseOldUTF8Behavior,   getUseOnlyServerErrorMessages,   getUseReadAheadInput,   getUseSSL,   getUseSSPSCompatibleTimezoneShift,   getUseServerPrepStmts,   getUseServerPreparedStmts,   getUseSqlStateCodes,   getUseStreamLengthsInPrepStmts,   getUseTimezone,   getUseUltraDevWorkAround,   getUseUnbufferedInput,   getUseUnicode,   getUseUsageAdvisor,   getUtf8OutsideBmpExcludedColumnNamePattern,   getUtf8OutsideBmpIncludedColumnNamePattern,   getVerifyServerCertificate,   getYearIsDateType,   getZeroDateTimeBehavior,   initializeFromRef,   initializeProperties,   postInitialization,   setAllowLoadLocalInfile,   setAllowMultiQueries,   setAllowNanAndInf,   setAllowUrlInLocalInfile,   setAlwaysSendSetIsolation,   setAutoClosePStmtStreams,   setAutoDeserialize,   setAutoGenerateTestcaseScript,   setAutoReconnect,   setAutoReconnectForConnectionPools,   setAutoReconnectForPools,   setAutoSlowLog,   setBlobSendChunkSize,   setBlobsAreStrings,   setCacheCallableStatements,   setCacheCallableStmts,   setCachePrepStmts,   setCachePreparedStatements,   setCacheResultSetMetadata,   setCacheServerConfiguration,   setCallableStatementCacheSize,   setCallableStmtCacheSize,   setCapitalizeDBMDTypes,   setCapitalizeTypeNames,   setCharacterEncoding,   setCharacterSetResults,   setClientCertificateKeyStorePassword,   setClientCertificateKeyStoreType,   setClientCertificateKeyStoreUrl,   setClientInfoProvider,   setClobCharacterEncoding,   setClobberStreamingResults,   setCompensateOnDuplicateKeyUpdateCounts,   setConnectTimeout,   setConnectionCollation,   setConnectionLifecycleInterceptors,   setContinueBatchOnError,   setCreateDatabaseIfNotExist,   setDefaultFetchSize,   setDetectServerPreparedStmts,   setDontTrackOpenResources,   setDumpMetadataOnColumnNotFound,   setDumpQueriesOnException,   setDynamicCalendars,   setElideSetAutoCommits,   setEmptyStringsConvertToZero,   setEmulateLocators,   setEmulateUnsupportedPstmts,   setEnablePacketDebug,   setEnableQueryTimeouts,   setEncoding,   setExceptionInterceptors,   setExplainSlowQueries,   setFailOverReadOnly,   setFunctionsNeverReturnBlobs,   setGatherPerfMetrics,   setGatherPerformanceMetrics,   setGenerateSimpleParameterMetadata,   setHighAvailability,   setHoldResultsOpenOverStatementClose,   setIgnoreNonTxTables,   setIncludeInnodbStatusInDeadlockExceptions,   setInitialTimeout,   setInteractiveClient,   setIsInteractiveClient,   setJdbcCompliantTruncation,   setJdbcCompliantTruncationForReads,   setLargeRowSizeThreshold,   setLoadBalanceBlacklistTimeout,   setLoadBalanceStrategy,   setLocalSocketAddress,   setLocatorFetchBufferSize,   setLogSlowQueries,   setLogXaCommands,   setLogger,   setLoggerClassName,   setMaintainTimeStats,   setMaxAllowedPacket,   setMaxQuerySizeToLog,   setMaxReconnects,   setMaxRows,   setMetadataCacheSize,   setNetTimeoutForStreamingResults,   setNoAccessToProcedureBodies,   setNoDatetimeStringSync,   setNoTimezoneConversionForTimeType,   setNullCatalogMeansCurrent,   setNullNamePatternMatchesAll,   setOverrideSupportsIntegrityEnhancementFacility,   setPacketDebugBufferSize,   setPadCharsWithSpace,   setParanoid,   setPasswordCharacterEncoding,   setPedantic,   setPinGlobalTxToPhysicalConnection,   setPopulateInsertRowWithDefaultValues,   setPrepStmtCacheSize,   setPrepStmtCacheSqlLimit,   setPreparedStatementCacheSize,   setPreparedStatementCacheSqlLimit,   setProcessEscapeCodesForPrepStmts,   setProfileSQL,   setProfileSql,   setProfilerEventHandler,   setPropertiesTransform,   setQueriesBeforeRetryMaster,   setQueryTimeoutKillsConnection,   setReconnectAtTxEnd,   setRelaxAutoCommit,   setReportMetricsIntervalMillis,   setRequireSSL,   setResourceId,   setResultSetSizeThreshold,   setRetainStatementAfterResultSetClose,   setRetriesAllDown,   setRewriteBatchedStatements,   setRollbackOnPooledClose,   setRoundRobinLoadBalance,   setRunningCTS13,   setSecondsBeforeRetryMaster,   setSelfDestructOnPingMaxOperations,   setSelfDestructOnPingSecondsLifetime,   setServerTimezone,   setSessionVariables,   setSlowQueryThresholdMillis,   setSlowQueryThresholdNanos,   setSocketFactory,   setSocketFactoryClassName,   setSocketTimeout,   setStatementInterceptors,   setStrictFloatingPoint,   setStrictUpdates,   setTcpKeepAlive,   setTcpNoDelay,   setTcpRcvBuf,   setTcpSndBuf,   setTcpTrafficClass,   setTinyInt1isBit,   setTraceProtocol,   setTransformedBitIsBoolean,   setTreatUtilDateAsTimestamp,   setTrustCertificateKeyStorePassword,   setTrustCertificateKeyStoreType,   setTrustCertificateKeyStoreUrl,   setUltraDevHack,   setUseAffectedRows,   setUseBlobToStoreUTF8OutsideBMP,   setUseColumnNamesInFindColumn,   setUseCompression,   setUseConfigs,   setUseCursorFetch,   setUseDirectRowUnpack,   setUseDynamicCharsetInfo,   setUseFastDateParsing,   setUseFastIntParsing,   setUseGmtMillisForDatetimes,   setUseHostsInPrivileges,   setUseInformationSchema,   setUseJDBCCompliantTimezoneShift,   setUseJvmCharsetConverters,   setUseLegacyDatetimeCode,   setUseLocalSessionState,   setUseLocalTransactionState,   setUseNanosForElapsedTime,   setUseOldAliasMetadataBehavior,   setUseOldUTF8Behavior,   setUseOnlyServerErrorMessages,   setUseReadAheadInput,   setUseSSL,   setUseSSPSCompatibleTimezoneShift,   setUseServerPrepStmts,   setUseServerPreparedStmts,   setUseSqlStateCodes,   setUseStreamLengthsInPrepStmts,   setUseTimezone,   setUseUltraDevWorkAround,   setUseUnbufferedInput,   setUseUnicode,   setUseUsageAdvisor,   setUtf8OutsideBmpExcludedColumnNamePattern,   setUtf8OutsideBmpIncludedColumnNamePattern,   setVerifyServerCertificate,   setYearIsDateType,   setZeroDateTimeBehavior,   storeToRef,   useUnbufferedInput
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from com.mysql.jdbc.jdbc2.optional.MysqlDataSource Detail:
 public Connection getConnection() throws SQLException 
    Creates a new connection using the already configured username and password.
 protected Connection getConnection(Properties props) throws SQLException 
    Creates a connection using the specified properties.
 public Connection getConnection(String userID,
    String pass) throws SQLException 
    Creates a new connection with the given username and password
 public String getDatabaseName() 
    Gets the name of the database
 public PrintWriter getLogWriter() 
    Returns the log writer for this data source
 public int getLoginTimeout() 
    Returns the login timeout
 public int getPort() 
    Returns the port number
 public int getPortNumber() 
    Returns the port number
 public Reference getReference() throws NamingException 
    Required method to support this class as a Referenceable.
 public String getServerName() 
    Returns the name of the database server
 public String getURL() 
    Returns the URL for this connection
 public String getUrl() 
    Returns the JDBC URL that will be used to create the database connection.
 public String getUser() 
    Returns the configured user for this connection
 public  void setDatabaseName(String dbName) 
    Sets the database name.
 public  void setLogWriter(PrintWriter output) throws SQLException 
    Sets the log writer for this data source.
 public  void setLoginTimeout(int seconds) throws SQLException 
    DOCUMENT ME!
 public  void setPassword(String pass) 
    Sets the password
 public  void setPort(int p) 
    Sets the database port.
 public  void setPortNumber(int p) 
    Sets the port number
 public  void setPropertiesViaRef(Reference ref) throws SQLException 
    DOCUMENT ME!
 public  void setServerName(String serverName) 
    Sets the server name.
 public  void setURL(String url) 
    Sets the URL for this connection
 public  void setUrl(String url) 
    This method is used by the app server to set the url string specified within the datasource deployment descriptor. It is discovered using introspection and matches if property name in descriptor is "url".
 public  void setUser(String userID) 
    Sets the user ID.