Package org.jivesoftware.database
Class EmbeddedConnectionProvider
- java.lang.Object
-
- org.jivesoftware.database.EmbeddedConnectionProvider
-
- All Implemented Interfaces:
ConnectionProvider
public class EmbeddedConnectionProvider extends Object implements ConnectionProvider
A connection provider for the embedded hsqlDB database. The database file is stored athome/database. The log file for this connection provider is stored at[home]/logs/EmbeddedConnectionProvider.log, so you should ensure that the[home]/logsdirectory exists.- Author:
- Matt Tucker
-
-
Constructor Summary
Constructors Constructor Description EmbeddedConnectionProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Tells the connection provider to destroy itself.voidfinalize()ConnectiongetConnection()Returns a database connection.booleanisPooled()Returns true if this connection provider provides connections out of a connection pool.voidrestart()This method should be called whenever properties have been changed so that the changes will take effect.voidstart()Starts the connection provider.
-
-
-
Method Detail
-
isPooled
public boolean isPooled()
Description copied from interface:ConnectionProviderReturns true if this connection provider provides connections out of a connection pool. Implementing and using connection providers that are pooled is strongly recommended, as they greatly increase the speed of Jive.- Specified by:
isPooledin interfaceConnectionProvider- Returns:
- true if the Connection objects returned by this provider are pooled.
-
getConnection
public Connection getConnection() throws SQLException
Description copied from interface:ConnectionProviderReturns a database connection. When a Jive component is done with a connection, it will call the close method of that connection. Therefore, connection pools with special release methods are not directly supported by the connection provider infrastructure. Instead, connections from those pools should be wrapped such that calling the close method on the wrapper class will release the connection from the pool.- Specified by:
getConnectionin interfaceConnectionProvider- Returns:
- a Connection object.
- Throws:
SQLException- is an SQL error occured while retrieving the connection.
-
start
public void start()
Description copied from interface:ConnectionProviderStarts the connection provider. For some connection providers, this will be a no-op. However, connection provider users should always call this method to make sure the connection provider is started.- Specified by:
startin interfaceConnectionProvider
-
restart
public void restart()
Description copied from interface:ConnectionProviderThis method should be called whenever properties have been changed so that the changes will take effect.- Specified by:
restartin interfaceConnectionProvider
-
destroy
public void destroy()
Description copied from interface:ConnectionProviderTells the connection provider to destroy itself. For many connection providers, this will essentially result in a no-op. However, connection provider users should always call this method when changing from one connection provider to another to ensure that there are no dangling database connections.- Specified by:
destroyin interfaceConnectionProvider
-
-