org.wamblee.support.persistence
Class DerbyDatabase

java.lang.Object
  extended by org.wamblee.support.persistence.AbstractDatabase
      extended by org.wamblee.support.persistence.DerbyDatabase
All Implemented Interfaces:
Database

public class DerbyDatabase
extends AbstractDatabase

Derby database setup. The external JDBC url used to connect to a running instance is

     jdbc:derby:net://localhost:1527/testdb
 
and the driver class is
 com.ibm.db2.jcc.DB2Driver
 
The following jars will have to be used db2jcc.jar and db2jcc_license_c.jar.


Constructor Summary
DerbyDatabase()
          Constructs derby database class to allow creation of derby database instances.
DerbyDatabase(boolean aInMemoryFlag)
           
 
Method Summary
 java.sql.Connection createConnection()
           
 void doStart()
           
 void doStop()
          Stops the derby database and cleans up all derby files.
 java.lang.String getExternalJdbcUrl()
          Gets the external Jdbc URL to connect to this database from other JVMs.
 java.lang.String getJdbcUrl()
          Gets the Jdbc Url to connect to this database.
 java.lang.String getPassword()
          Gets the password.
 java.lang.String getUsername()
          Gets the user name.
 
Methods inherited from class org.wamblee.support.persistence.AbstractDatabase
createDataSource, getActiveConnections, getProperty, start, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DerbyDatabase

public DerbyDatabase()
Constructs derby database class to allow creation of derby database instances.


DerbyDatabase

public DerbyDatabase(boolean aInMemoryFlag)
Method Detail

doStart

public void doStart()
Specified by:
doStart in class AbstractDatabase

getJdbcUrl

public java.lang.String getJdbcUrl()
Description copied from interface: Database
Gets the Jdbc Url to connect to this database.

Returns:
Jdbc Url.

getExternalJdbcUrl

public java.lang.String getExternalJdbcUrl()
Description copied from interface: Database
Gets the external Jdbc URL to connect to this database from other JVMs.


getUsername

public java.lang.String getUsername()
Gets the user name.

Returns:
username.

getPassword

public java.lang.String getPassword()
Gets the password.

Returns:

createConnection

public java.sql.Connection createConnection()
                                     throws java.sql.SQLException
Throws:
java.sql.SQLException

doStop

public void doStop()
Stops the derby database and cleans up all derby files.

Specified by:
doStop in class AbstractDatabase


Copyright © 2010. All Rights Reserved.