org.infinispan.loaders.jdbc.connectionfactory
Class SimpleConnectionFactory

java.lang.Object
  extended by org.infinispan.loaders.jdbc.connectionfactory.ConnectionFactory
      extended by org.infinispan.loaders.jdbc.connectionfactory.SimpleConnectionFactory

public class SimpleConnectionFactory
extends ConnectionFactory

Connection factory implementation that will create database connection on a per invocation basis. Not recommended in production, PooledConnectionFactory should rather be used.

Author:
Mircea.Markus@jboss.com

Constructor Summary
SimpleConnectionFactory()
           
 
Method Summary
 Connection getConnection()
          Fetches a connection from the factory.
 String getConnectionUrl()
           
 String getPassword()
           
 String getUserName()
           
 void releaseConnection(Connection conn)
          Destroys a connection.
 void start(ConnectionFactoryConfig config, ClassLoader classLoader)
          Starts the connection factory.
 void stop()
          Closes the connection factory, including all allocated connections etc.
 String toString()
           
 
Methods inherited from class org.infinispan.loaders.jdbc.connectionfactory.ConnectionFactory
getConnectionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SimpleConnectionFactory

public SimpleConnectionFactory()
Method Detail

start

public void start(ConnectionFactoryConfig config,
                  ClassLoader classLoader)
           throws CacheLoaderException
Description copied from class: ConnectionFactory
Starts the connection factory. A pooled factory might be create connections here.

Specified by:
start in class ConnectionFactory
Throws:
CacheLoaderException

stop

public void stop()
Description copied from class: ConnectionFactory
Closes the connection factory, including all allocated connections etc.

Specified by:
stop in class ConnectionFactory

getConnection

public Connection getConnection()
                         throws CacheLoaderException
Description copied from class: ConnectionFactory
Fetches a connection from the factory.

Specified by:
getConnection in class ConnectionFactory
Throws:
CacheLoaderException

releaseConnection

public void releaseConnection(Connection conn)
Description copied from class: ConnectionFactory
Destroys a connection. Important: null might be passed in, as an valid argument.

Specified by:
releaseConnection in class ConnectionFactory

getConnectionUrl

public String getConnectionUrl()

getUserName

public String getUserName()

getPassword

public String getPassword()

toString

public String toString()
Overrides:
toString in class Object

-->

Copyright © 2012 JBoss, a division of Red Hat. All Rights Reserved.