## org.h2.engine
Class ConnectionInfo

    java.lang.Object
      org.h2.engine.ConnectionInfo

All Implemented Interfaces:
  java.lang.Cloneable

    public class ConnectionInfo

extends java.lang.Object
implements java.lang.Cloneable

Encapsulates the connection settings, including user name and password.

Constructor Summary
`ConnectionInfo(java.lang.String name)` Create a connection info object.
`ConnectionInfo(java.lang.String u, java.util.Properties info)` Create a connection info object.

Method Summary
`java.lang.Object` `clone()`
`java.lang.String` `getOriginalURL()` Get the complete original database URL.
`boolean` `getProperty(java.lang.String key, boolean defaultValue)` Get a boolean property if it is set and return the value.
`int` `getProperty(java.lang.String key, int defaultValue)` Get the value of the given property.
`java.lang.String` `getProperty(java.lang.String key, java.lang.String defaultValue)` Get the value of the given property.
`java.lang.String` `getURL()` Get the database URL.
`java.lang.String` `getUserName()` Get the name of the user.
`boolean` `isRemote()` Check if this is a remote connection.
`boolean` `removeProperty(java.lang.String key, boolean defaultValue)` Remove a boolean property if it is set and return the value.
`void` `setBaseDir(java.lang.String dir)` Set the base directory of persistent databases, unless the database is in the user home folder (~).
`void` `setFilePasswordHash(byte[] hash)` Set the file password hash.
`void` `setOriginalURL(java.lang.String url)` Set the original database URL.
`void` `setProperty(java.lang.String key, java.lang.String value)` Overwrite a property.
`void` `setServerKey(java.lang.String serverKey)` Switch to server mode, and set the server name and database key.
`void` `setUserName(java.lang.String name)` Overwrite the user name.
`void` `setUserPasswordHash(byte[] hash)` Set the user password hash.

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ConnectionInfo

    public ConnectionInfo(java.lang.String name)

  Create a connection info object.

  Parameters:
    `name` - the database name (including tags), but without the "jdbc:h2:" prefix

### ConnectionInfo

    public ConnectionInfo(java.lang.String u,
                          java.util.Properties info)

  Create a connection info object.

  Parameters:
    `u` - the database URL (must start with jdbc:h2:)
    `info` - the connection properties

Method Detail

### clone

    public java.lang.Object clone()
                           throws java.lang.CloneNotSupportedException

  Overrides:
    `clone` in class `java.lang.Object`
  Throws:
    `java.lang.CloneNotSupportedException`

### setBaseDir

    public void setBaseDir(java.lang.String dir)

  Set the base directory of persistent databases, unless the database is in the user home folder (~).

  Parameters:
    `dir` - the new base directory

### isRemote

    public boolean isRemote()

  Check if this is a remote connection.

  Returns:
    true if it is

### getProperty

    public boolean getProperty(java.lang.String key,
                               boolean defaultValue)

  Get a boolean property if it is set and return the value.

  Parameters:
    `key` - the property name
    `defaultValue` - the default value
  Returns:
    the value

### removeProperty

    public boolean removeProperty(java.lang.String key,
                                  boolean defaultValue)

  Remove a boolean property if it is set and return the value.

  Parameters:
    `key` - the property name
    `defaultValue` - the default value
  Returns:
    the value

### getUserName

    public java.lang.String getUserName()

  Get the name of the user.

  Returns:
    the user name

### getProperty

    public int getProperty(java.lang.String key,
                           int defaultValue)

  Get the value of the given property.

  Parameters:
    `key` - the property key
    `defaultValue` - the default value
  Returns:
    the value as a String

### getProperty

    public java.lang.String getProperty(java.lang.String key,
                                        java.lang.String defaultValue)

  Get the value of the given property.

  Parameters:
    `key` - the property key
    `defaultValue` - the default value
  Returns:
    the value as a String

### setUserName

    public void setUserName(java.lang.String name)

  Overwrite the user name. The user name is case-insensitive and stored in uppercase. English conversion is used.

  Parameters:
    `name` - the user name

### setUserPasswordHash

    public void setUserPasswordHash(byte[] hash)

  Set the user password hash.

  Parameters:
    `hash` - the new hash value

### setFilePasswordHash

    public void setFilePasswordHash(byte[] hash)

  Set the file password hash.

  Parameters:
    `hash` - the new hash value

### setProperty

    public void setProperty(java.lang.String key,
                            java.lang.String value)

  Overwrite a property.

  Parameters:
    `key` - the property name
    `value` - the value

### getURL

    public java.lang.String getURL()

  Get the database URL.

  Returns:
    the URL

### getOriginalURL

    public java.lang.String getOriginalURL()

  Get the complete original database URL.

  Returns:
    the database URL

### setOriginalURL

    public void setOriginalURL(java.lang.String url)

  Set the original database URL.

  Parameters:
    `url` - the database url

### setServerKey

    public void setServerKey(java.lang.String serverKey)

  Switch to server mode, and set the server name and database key.

  Parameters:
    `serverKey` - the server name, '/', and the security key