org.wso2.registry.jdbc
Class ConnectionFactory

java.lang.Object
  extended by org.wso2.registry.jdbc.ConnectionFactory

public class ConnectionFactory
extends java.lang.Object

Manages the database connections of the JDBC registry. This can be configured on 2 ways.

1) Using a datasource Data source name has to be specified in the constructor. If the default constructor is used "java:comp/env/jdbc/WSO2RegistryDB" is used as the data source name.

2) Using a database connection URL

In either case, we can specify whether this should use HSQL in-memory database in case of a failure of above methods. If in-memory database is allowed, relevant hsql jars should in the class path.


Constructor Summary
ConnectionFactory()
           
ConnectionFactory(java.lang.String dataSourceName)
           
ConnectionFactory(java.lang.String driverClass, java.lang.String url, java.lang.String userName, java.lang.String password)
           
 
Method Summary
 java.sql.Connection getConnection()
           
 javax.sql.DataSource getDataSource()
           
 boolean isAllowInMemoryDatabase()
           
 void setAllowInMemoryDatabase(boolean allowInMemoryDatabase)
           
 void shutdown()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionFactory

public ConnectionFactory()
                  throws RegistryException
Throws:
RegistryException

ConnectionFactory

public ConnectionFactory(java.lang.String dataSourceName)
                  throws RegistryException
Throws:
RegistryException

ConnectionFactory

public ConnectionFactory(java.lang.String driverClass,
                         java.lang.String url,
                         java.lang.String userName,
                         java.lang.String password)
                  throws RegistryException
Throws:
RegistryException
Method Detail

isAllowInMemoryDatabase

public boolean isAllowInMemoryDatabase()

setAllowInMemoryDatabase

public void setAllowInMemoryDatabase(boolean allowInMemoryDatabase)

getDataSource

public javax.sql.DataSource getDataSource()
                                   throws RegistryException
Throws:
RegistryException

getConnection

public java.sql.Connection getConnection()
                                  throws RegistryException
Throws:
RegistryException

shutdown

public void shutdown()
              throws java.lang.Exception
Throws:
java.lang.Exception


Copyright © 2007 Apache Web Services Project. All Rights Reserved.