|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.btb.ConnectionManager
public class ConnectionManager
Manages database URLs for the bridges' properties file. It's possible to define more than one database URL in the file or to load connection attributes from another file.
You can change the path of the bridge.properties file by setting the system property attribute "bridge.properties.path" to the desired file path.
| Constructor Summary | |
|---|---|
ConnectionManager()
|
|
| Method Summary | |
|---|---|
java.sql.Connection |
createConnection()
Creates a connection using the default connection string. |
java.sql.Connection |
createConnection(java.lang.String name)
Creates a connection using the specified connection name. |
java.lang.String |
getDefault()
Gets the default database.url name. |
java.lang.String |
getUrl()
Gets the default database URL (the database.url. |
java.lang.String |
getUrl(java.lang.String name)
Get the specified connection string. |
void |
loadAttributes()
Loads the default attribute file as defined by the system property "bridge.properties.path". |
void |
loadAttributes(java.lang.String filePath)
Load the specified attribute file. |
void |
saveAttributes()
Saves the default attribute file as defined by ConnectionManager.FILE_PATH. |
void |
saveAttributes(java.lang.String filePath)
Saves the changes to the attribute file specified. |
void |
setDefault(java.lang.String name)
Sets the default database url name. |
void |
setUrl(java.lang.String url)
Sets the default database URL. |
void |
setUrl(java.lang.String name,
java.lang.String url)
Sets the url value to the database.url. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConnectionManager()
| Method Detail |
|---|
public void loadAttributes()
throws java.io.IOException
java.io.IOException - if the file does not exist.
public void loadAttributes(java.lang.String filePath)
throws java.io.IOException
filePath - Path to the file to load.
java.io.IOException - if the file does not exist.
public void saveAttributes()
throws java.io.IOException
java.io.IOException - if there is a problem during the save operation.
public void saveAttributes(java.lang.String filePath)
throws java.io.IOException
filePath - The path to the file to be saved.
java.io.IOException - if there is a problem during the save operation.
public java.sql.Connection createConnection()
throws java.sql.SQLException
java.sql.SQLException - if there is a problem connecting to the database or if the
connection string is invalid.
public java.sql.Connection createConnection(java.lang.String name)
throws java.sql.SQLException
name - The name of the connection to create.
java.sql.SQLException - if there is a problem connecting to the database or if the
connection string is invalid.public java.lang.String getUrl(java.lang.String name)
name - The name of the connection string to get.
public void setUrl(java.lang.String name,
java.lang.String url)
name - The name of the connection.url to set.url - the url value.public java.lang.String getUrl()
String containing the database URL.public void setUrl(java.lang.String url)
url - The url to set to the default database.url attribute.public java.lang.String getDefault()
public void setDefault(java.lang.String name)
name - The name of the default database.url to use.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||