类 MysqlDataSource

    • 字段详细资料

      • mysqlDriver

        protected static final NonRegisteringDriver mysqlDriver
        The driver to create connections with
      • logWriter

        protected transient PrintWriter logWriter
        Log stream
      • databaseName

        protected String databaseName
        Database Name
      • encoding

        protected String encoding
        Character Encoding
      • url

        protected String url
        The JDBC URL
      • explicitUrl

        protected boolean explicitUrl
        Should we construct the URL, or has it been set explicitly?
      • hostName

        protected String hostName
        Hostname
      • port

        protected int port
        Port number
      • explicitPort

        protected boolean explicitPort
        Was the port explicitly set?
      • user

        protected String user
        User name
      • password

        protected String password
        Password
      • profileSQLString

        protected String profileSQLString
        The profileSQL property
      • description

        protected String description
    • 构造器详细资料

      • MysqlDataSource

        public MysqlDataSource()
        Default no-arg constructor for Serialization
    • 方法详细资料

      • getDescription

        public String getDescription()
      • setDescription

        public void setDescription​(String value)
      • setDatabaseName

        public void setDatabaseName​(String dbName)
        Sets the database name.
        参数:
        dbName - the name of the database
      • getDatabaseName

        public String getDatabaseName()
        Gets the name of the database
        返回:
        the name of the database for this data source
      • setPassword

        public void setPassword​(String pass)
        Sets the password
        参数:
        pass - the password
      • getPassword

        public String getPassword()
        Get the password.
        返回:
        password
      • setPort

        public void setPort​(int p)
        Sets the database port.
        参数:
        p - the port
      • getPort

        public int getPort()
        Returns the port number
        返回:
        the port number
      • setPortNumber

        public void setPortNumber​(int p)
        Sets the port number
        参数:
        p - the port
      • getPortNumber

        public int getPortNumber()
        Returns the port number
        返回:
        the port number
      • setPropertiesViaRef

        public void setPropertiesViaRef​(Reference ref)
                                 throws SQLException
        Initializes driver properties that come from a JNDI reference (in the case of a javax.sql.DataSource bound into some name service that doesn't handle Java objects directly).
        参数:
        ref - The JNDI Reference that holds RefAddrs for all properties
        抛出:
        SQLException - if error occurs
      • setServerName

        public void setServerName​(String serverName)
        Sets the server name.
        参数:
        serverName - the server name
      • getServerName

        public String getServerName()
        Returns the name of the database server
        返回:
        the name of the database server
      • setURL

        public void setURL​(String url)
        Sets the URL for this connection
        参数:
        url - the URL for this connection
      • getURL

        public String getURL()
        Returns the URL for this connection
        返回:
        the URL for this connection
      • setUrl

        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".
        参数:
        url - url to be used within driver.connect
      • getUrl

        public String getUrl()
        Returns the JDBC URL that will be used to create the database connection.
        返回:
        the URL for this connection
      • setUser

        public void setUser​(String userID)
        Sets the user ID.
        参数:
        userID - the User ID
      • getUser

        public String getUser()
        Returns the configured user for this connection
        返回:
        the user for this connection
      • getConnection

        protected Connection getConnection​(Properties props)
                                    throws SQLException
        Creates a connection using the specified properties.
        参数:
        props - the properties to connect with
        返回:
        a connection to the database
        抛出:
        SQLException - if an error occurs
      • getStringRuntimeProperty

        protected String getStringRuntimeProperty​(String name)
                                           throws SQLException
        Used in properties getters added by instrumentation.
        参数:
        name - property name property name
        返回:
        property value
        抛出:
        SQLException - if error occurs
      • setStringRuntimeProperty

        protected void setStringRuntimeProperty​(String name,
                                                String value)
                                         throws SQLException
        Used in properties setters added by instrumentation.
        参数:
        name - property name
        value - value
        抛出:
        SQLException - if error occurs
      • getBooleanRuntimeProperty

        protected boolean getBooleanRuntimeProperty​(String name)
                                             throws SQLException
        Used in properties getters added by instrumentation.
        参数:
        name - property name
        返回:
        property value
        抛出:
        SQLException - if error occurs
      • setBooleanRuntimeProperty

        protected void setBooleanRuntimeProperty​(String name,
                                                 boolean value)
                                          throws SQLException
        Used in properties setters added by instrumentation.
        参数:
        name - property name
        value - value
        抛出:
        SQLException - if error occurs
      • getIntegerRuntimeProperty

        protected int getIntegerRuntimeProperty​(String name)
                                         throws SQLException
        Used in properties getters added by instrumentation.
        参数:
        name - property name
        返回:
        property value
        抛出:
        SQLException - if error occurs
      • setIntegerRuntimeProperty

        protected void setIntegerRuntimeProperty​(String name,
                                                 int value)
                                          throws SQLException
        Used in properties setters added by instrumentation.
        参数:
        name - property name
        value - value
        抛出:
        SQLException - if error occurs
      • getLongRuntimeProperty

        protected long getLongRuntimeProperty​(String name)
                                       throws SQLException
        Used in properties getters added by instrumentation.
        参数:
        name - property name
        返回:
        property value
        抛出:
        SQLException - if error occurs
      • setLongRuntimeProperty

        protected void setLongRuntimeProperty​(String name,
                                              long value)
                                       throws SQLException
        Used in properties setters added by instrumentation.
        参数:
        name - property name
        value - value
        抛出:
        SQLException - if error occurs
      • getMemorySizeRuntimeProperty

        protected int getMemorySizeRuntimeProperty​(String name)
                                            throws SQLException
        Used in properties getters added by instrumentation.
        参数:
        name - property name
        返回:
        property value
        抛出:
        SQLException - if error occurs
      • setMemorySizeRuntimeProperty

        protected void setMemorySizeRuntimeProperty​(String name,
                                                    int value)
                                             throws SQLException
        Used in properties setters added by instrumentation.
        参数:
        name - property name
        value - value
        抛出:
        SQLException - if error occurs
      • getEnumRuntimeProperty

        protected String getEnumRuntimeProperty​(String name)
                                         throws SQLException
        Used in properties getters added by instrumentation.
        参数:
        name - property name
        返回:
        property value
        抛出:
        SQLException - if error occurs
      • setEnumRuntimeProperty

        protected void setEnumRuntimeProperty​(String name,
                                              String value)
                                       throws SQLException
        Used in properties setters added by instrumentation.
        参数:
        name - property name
        value - value
        抛出:
        SQLException - if error occurs