Class DerbyHelper

java.lang.Object
be.gaudry.dao.derby.DerbyHelper
All Implemented Interfaces:
PropertyChangeListener, EventListener

public class DerbyHelper extends Object implements PropertyChangeListener
Since:
1.0 Sep 18, 2009, 0.0.2-SNAPSHOT
Version:
%I%, %G%
Author:
Steph GAUDRY
  • Field Details

    • EMBEDDED_DRIVER

      public static String EMBEDDED_DRIVER
    • LANGUAGE_PATH

      public static String LANGUAGE_PATH
      Key to access to the language resource bundle
    • LOGGER

      public static final org.apache.commons.logging.Log LOGGER
  • Method Details

    • getLocalString

      public static String getLocalString(String languageKey)
      Uses Localized properties to get some strings.
      Parameters:
      languageKey - key to access to the localized string
      Returns:
      localized string or null if an error occurs
    • exists

      public static boolean exists(String dbName)
    • loadDatabaseDriver

      public static void loadDatabaseDriver(String driverName)
    • createDerbyDirectory

      public static void createDerbyDirectory(String dbName) throws Exception
      Creates the databases directory. This is the same default directory for all BrolDev applications, and specific databases are into sub-directories
      Throws:
      Exception
    • deleteDerbyDirectory

      public static boolean deleteDerbyDirectory(String dbName)
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • getDBConnection

      public static Connection getDBConnection(String dbName)
    • create

      public static Connection create(String dbName)
    • connect

      public static boolean connect(String dbName)
    • enableJDBCLogging

      public static void enableJDBCLogging()
    • getInfos

      public static String getInfos(String dbName)
    • prepareStmt

      public static PreparedStatement prepareStmt(String dbName, String sql) throws SQLException
      Throws:
      SQLException
    • prepareStmt

      public static PreparedStatement prepareStmt(String dbName, String sql, int autoGeneratedKeys) throws SQLException
      Throws:
      SQLException
    • prepareStmt

      public static PreparedStatement prepareStmt(String dbName, String sql, int autoGeneratedKeys, int resultSetConcurrency) throws SQLException
      Throws:
      SQLException
    • prepareStmt

      public static PreparedStatement prepareStmt(String dbName, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability) throws SQLException
      Throws:
      SQLException
    • getDAOVersion

      public static String getDAOVersion(String dbName)