Encapsulates the connection settings, including user name and password.
Methods |
|
ConnectionInfo(String name)
Create a connection info object.
|
|
ConnectionInfo(String name)
Create a connection info object.
Parameters:
name - the database name (including tags), but without the
"jdbc:h2:" prefix
|
|
ConnectionInfo(String u, Properties info)
Create a connection info object.
|
|
ConnectionInfo(String u, Properties info)
Create a connection info object.
Parameters:
u - the database URL (must start with jdbc:h2:)
info - the connection properties
|
ConnectionInfo |
clone()
|
ConnectionInfo |
clone() throws CloneNotSupportedException
|
DbSettings |
getDbSettings()
|
DbSettings |
getDbSettings()
|
byte[] |
getFilePasswordHash()
Get the file password hash if it is set.
|
byte[] |
getFilePasswordHash()
Get the file password hash if it is set.
Returns:
the password hash or null
|
String |
getName()
Get the unique and normalized database name (excluding settings).
|
String |
getName()
Get the unique and normalized database name (excluding settings).
Returns:
the database name
|
String |
getOriginalURL()
Get the complete original database URL.
|
String |
getOriginalURL()
Get the complete original database URL.
Returns:
the database URL
|
String |
getProperty(String key, String defaultValue)
Get the value of the given property.
|
String |
getProperty(String key, String defaultValue)
Get the value of the given property.
Parameters:
key - the property key
defaultValue - the default value
Returns:
the value as a String
|
String |
getURL()
Get the database URL.
|
String |
getURL()
Get the database URL.
Returns:
the URL
|
String |
getUserName()
Get the name of the user.
|
String |
getUserName()
Get the name of the user.
Returns:
the user name
|
boolean |
isPersistent()
Check if the referenced database is persistent.
|
boolean |
isPersistent()
Check if the referenced database is persistent.
Returns:
true if it is
|
boolean |
isRemote()
Check if this is a remote connection.
|
boolean |
isRemote()
Check if this is a remote connection.
Returns:
true if it is
|
boolean |
removeProperty(String key, boolean defaultValue)
Remove a boolean property if it is set and return the value.
|
boolean |
removeProperty(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
|
void |
setBaseDir(String dir)
Set the base directory of persistent databases, unless the database is in
the user home folder (~).
|
void |
setBaseDir(String dir)
Set the base directory of persistent databases, unless the database is in
the user home folder (~).
Parameters:
dir - the new base directory
|
void |
setFileEncryptionKey(byte[] key)
|
void |
setFileEncryptionKey(byte[] key)
|
void |
setFilePasswordHash(byte[] hash)
Set the file password hash.
|
void |
setFilePasswordHash(byte[] hash)
Set the file password hash.
Parameters:
hash - the new hash value
|
void |
setOriginalURL(String url)
Set the original database URL.
|
void |
setOriginalURL(String url)
Set the original database URL.
Parameters:
url - the database url
|
void |
setProperty(String key, String value)
Overwrite a property.
|
void |
setProperty(String key, String value)
Overwrite a property.
Parameters:
key - the property name
value - the value
|
void |
setServerKey(String serverKey)
Switch to server mode, and set the server name and database key.
|
void |
setServerKey(String serverKey)
Switch to server mode, and set the server name and database key.
Parameters:
serverKey - the server name, '/', and the security key
|
void |
setUserName(String name)
Overwrite the user name.
|
void |
setUserName(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
|
void |
setUserPasswordHash(byte[] hash)
Set the user password hash.
|
void |
setUserPasswordHash(byte[] hash)
Set the user password hash.
Parameters:
hash - the new hash value
|