Package be.gaudry.dao.derby
Class DerbyHelper
java.lang.Object
be.gaudry.dao.derby.DerbyHelper
- All Implemented Interfaces:
PropertyChangeListener,EventListener
- Since:
- 1.0 Sep 18, 2009, 0.0.2-SNAPSHOT
- Version:
- %I%, %G%
- Author:
- Steph GAUDRY
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanstatic Connectionstatic voidcreateDerbyDirectory(String dbName)Creates the databases directory.static booleandeleteDerbyDirectory(String dbName)static voidstatic booleanstatic StringgetDAOVersion(String dbName)static ConnectiongetDBConnection(String dbName)static Stringstatic StringgetLocalString(String languageKey)Uses Localized properties to get some strings.static voidloadDatabaseDriver(String driverName)static PreparedStatementprepareStmt(String dbName, String sql)static PreparedStatementprepareStmt(String dbName, String sql, int autoGeneratedKeys)static PreparedStatementprepareStmt(String dbName, String sql, int autoGeneratedKeys, int resultSetConcurrency)static PreparedStatementprepareStmt(String dbName, String sql, int resultSetType, int resultSetConcurrency, int resultSetHoldability)void
-
Field Details
-
EMBEDDED_DRIVER
-
LANGUAGE_PATH
Key to access to the language resource bundle -
LOGGER
public static final org.apache.commons.logging.Log LOGGER
-
-
Method Details
-
getLocalString
Uses Localized properties to get some strings.- Parameters:
languageKey- key to access to the localized string- Returns:
- localized string or
nullif an error occurs
-
exists
-
loadDatabaseDriver
-
createDerbyDirectory
Creates the databases directory. This is the same default directory for all BrolDev applications, and specific databases are into sub-directories- Throws:
Exception
-
deleteDerbyDirectory
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
getDBConnection
-
create
-
connect
-
enableJDBCLogging
public static void enableJDBCLogging() -
getInfos
-
prepareStmt
- 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
-