|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.metadata.ConnectionRepository
Field Summary |
Constructor Summary | |
ConnectionRepository()
|
Method Summary | |
void |
addDescriptor(JdbcConnectionDescriptor jcd)
Add a new JdbcConnectionDescriptor . |
JdbcConnectionDescriptor |
addDescriptor(java.lang.String jcdAlias,
javax.sql.DataSource dataSource,
java.lang.String username,
java.lang.String password)
Creates and adds a new connection descriptor for the given JDBC data source. |
JdbcConnectionDescriptor |
addDescriptor(java.lang.String jcdAlias,
java.lang.String jdbcDriver,
java.lang.String jdbcConnectionUrl,
java.lang.String username,
java.lang.String password)
Creates and adds a new connection descriptor for the given JDBC connection url. |
java.util.List |
getAllDescriptor()
Return a deep copy of all managed JdbcConnectionDescriptor . |
JdbcConnectionDescriptor |
getDescriptor(PBKey pbKey)
Returns the matching JdbcConnectionDescriptor
or null if no descriptor could be found. |
PBKey |
getStandardPBKeyForJcdAlias(java.lang.String jcdAlias)
Return the matching PBKey for
the given jcdAlias name, or null if no match
was found. |
void |
removeDescriptor(java.lang.Object validKey)
Remove a descriptor. |
java.lang.String |
toXML()
returns the XML marshalled version of this instance. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ConnectionRepository()
Method Detail |
public JdbcConnectionDescriptor getDescriptor(PBKey pbKey)
JdbcConnectionDescriptor
or null
if no descriptor could be found. The user name
and pass word will be set to match the supplied PBKey
object. If the original user name and pass word are desired, the PBKey
should be obtained with getStandardPBKeyForJcdAlias(String)
.
public PBKey getStandardPBKeyForJcdAlias(java.lang.String jcdAlias)
PBKey
for
the given jcdAlias name, or null
if no match
was found.
public void addDescriptor(JdbcConnectionDescriptor jcd)
JdbcConnectionDescriptor
.
public JdbcConnectionDescriptor addDescriptor(java.lang.String jcdAlias, java.lang.String jdbcDriver, java.lang.String jdbcConnectionUrl, java.lang.String username, java.lang.String password)
JdbcConnectionDescriptor.getDbms()
method.
For properties that are not part of the url, the following standard values are
explicitly set:
jcdAlias
- The connection alias for the created connection; if 'default' is used,
then the new descriptor will become the default connection descriptorjdbcDriver
- The fully qualified jdbc driver namejdbcConnectionUrl
- The connection url of the form '[protocol]:[sub protocol]:{database-specific path]'
where protocol is usually 'jdbc'username
- The user name (can be null
)password
- The password (can be null
)
JdbcConnectionDescriptor.getDbms()
public JdbcConnectionDescriptor addDescriptor(java.lang.String jcdAlias, javax.sql.DataSource dataSource, java.lang.String username, java.lang.String password)
JdbcConnectionDescriptor.getDbms()
method.
Note that the descriptor won't have a value for the driver because it is not possible
to retrieve the driver classname from the data source.
jcdAlias
- The connection alias for the created connection; if 'default' is used,
then the new descriptor will become the default connection descriptordataSource
- The data sourceusername
- The user name (can be null
)password
- The password (can be null
)
JdbcConnectionDescriptor.getDbms()
public void removeDescriptor(java.lang.Object validKey)
validKey
- This could be the JdbcConnectionDescriptor
itself, or the associated PBKey
.public java.util.List getAllDescriptor()
JdbcConnectionDescriptor
.
public java.lang.String toXML()
XmlCapable
toXML
in interface XmlCapable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |