av.rdb
Class ConnectionSource
java.lang.Object
av.rdb.ConnectionSource
public class ConnectionSource
- extends Object
This class serves as a source of Connection. It assumes the
following meta structure for configuration:
- <jdbc>
-
- <source>
-
- <driver class="jdbc.driver.ClassName" />
-
- <connection url="jdbc:connection:url">
- <user>user.name</user>
<password>user.passwd</password>
<other-property>some.value</other-property>
- </connection>
- </source>
- </jdbc>
See Ableverse Meta Facility for more information.
- Author:
- Compl
- See Also:
av.meta
|
Constructor Summary |
ConnectionSource(Meta meta)
Construct a new connection source with configuration information from
meta |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ConnectionSource
public ConnectionSource(Meta meta)
throws ConnectionSourceException
- Construct a new connection source with configuration information from
meta
- Parameters:
meta - a meta containing jdbc configuration information
- Throws:
ConnectionSourceException - if any error occured
getConnection
public Connection getConnection()
throws SQLException
- Establish a new connection with configured information.
- Returns:
- a new connection if successfully established
- Throws:
SQLException - if any error occured
testConnection
public boolean testConnection()
- Test if the configuration can successfully connect
- Returns:
- whether this source can successfully connect
Copyright© 2006 Ableverse Platform. All rights reserved.