CopaServer
Change of Plan Application
 All Classes Functions Pages
Classes | Static Public Member Functions | Static Public Attributes | List of all members
unicopa.copa.server.database.util.DatabaseUtil Class Reference

Utility methods for general database operations. More...

Collaboration diagram for unicopa.copa.server.database.util.DatabaseUtil:
Collaboration graph

Classes

class  ConnectException
 
class  CreateException
 

Static Public Member Functions

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 Public Attributes

static String driver = "org.apache.derby.jdbc.EmbeddedDriver"
 
static String protocol = "jdbc:derby:"
 

Detailed Description

Utility methods for general database operations.

Author
Felix Wiemuth

Member Function Documentation

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
ethe 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
conn

The documentation for this class was generated from the following file: