Utility methods for general database operations.
More...
|
class | ConnectException |
|
class | CreateException |
|
|
static void | createNewDatabase (File directory) throws CreateException, SQLException, ConnectException |
|
static Connection | getConnection (File database, boolean create) throws ConnectException |
| Get a connection to the database (embedded), configured the way it is needed for this application. More...
|
|
static Connection | getConnection (File database) throws ConnectException |
|
static boolean | shutDownDatabase () |
| Shutdown the database. More...
|
|
static void | loadDriver () |
| Loads the JDBC driver.
|
|
static String | formatSQLException (SQLException e) |
| Formats details of an SQLException chain as String . More...
|
|
|
static String | driver = "org.apache.derby.jdbc.EmbeddedDriver" |
|
static String | protocol = "jdbc:derby:" |
|
Utility methods for general database operations.
- Author
- Felix Wiemuth
static String unicopa.copa.server.database.util.DatabaseUtil.formatSQLException |
( |
SQLException |
e) | |
|
|
static |
Formats details of an SQLException chain as String
.
Details included are SQL State, Error code, Exception message.
- Parameters
-
e | the SQLException from which to get details. |
static Connection unicopa.copa.server.database.util.DatabaseUtil.getConnection |
( |
File |
database, |
|
|
boolean |
create |
|
) |
| throws ConnectException |
|
static |
Get a connection to the database (embedded), configured the way it is needed for this application.
If the connetion fails, everything is closed again automatically.
static boolean unicopa.copa.server.database.util.DatabaseUtil.shutDownDatabase |
( |
) | |
|
|
static |
Shutdown the database.
- Parameters
-
The documentation for this class was generated from the following file:
- CopaServer/src/main/java/unicopa/copa/server/database/util/DatabaseUtil.java