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
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
static Connection
static void
createDerbyDirectory(String dbName)
Creates the databases directory.static boolean
deleteDerbyDirectory(String dbName)
static void
static boolean
static String
getDAOVersion(String dbName)
static Connection
getDBConnection(String dbName)
static String
static String
getLocalString(String languageKey)
Uses Localized properties to get some strings.static void
loadDatabaseDriver(String driverName)
static PreparedStatement
prepareStmt(String dbName, String sql)
static PreparedStatement
prepareStmt(String dbName, String sql, int autoGeneratedKeys)
static PreparedStatement
prepareStmt(String dbName, String sql, int autoGeneratedKeys, int resultSetConcurrency)
static PreparedStatement
prepareStmt(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
null
if 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:
propertyChange
in 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
-