Ableverse™
Platform 6.0

av.rdb
Class ConnectionSource

java.lang.Object
  extended by 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
 
Method Summary
 Connection getConnection()
          Establish a new connection with configured information.
 boolean testConnection()
          Test if the configuration can successfully connect
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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
Method Detail

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

Ableverse™
Platform 6.0

Copyright© 2006 Ableverse Platform. All rights reserved.