org.apache.ojb.broker.util.dbhandling
Interface DBHandling

All Known Implementing Classes:
TorqueDBHandling

public interface DBHandling

Interface for classes providing basic database handling (drop, create, init).

Author:
Thomas Dudziak

Method Summary
 void addDBDefinitionFile(InputStream inputStream)
          Adds an input streams containg part of the db definition to use.
 void addDBDefinitionFiles(String srcDir, String listOfFilenames)
          Adds db definition files to use.
 void createDB()
          Creates the database.
 JdbcConnectionDescriptor getConnection()
          Returns the connection descriptor used by this handling object.
 void initDB()
          Creates the tables according to the schema files.
 void setConnection(JdbcConnectionDescriptor jcd)
          Sets the jdbc connection to use.
 void setWorkDir(String dir)
          Sets the working directory.
 

Method Detail

setWorkDir

void setWorkDir(String dir)
                throws IOException
Sets the working directory.

Parameters:
dir - The directory
Throws:
IOException - If the directory does not exist or cannot be written/read

setConnection

void setConnection(JdbcConnectionDescriptor jcd)
                   throws PlatformException
Sets the jdbc connection to use.

Parameters:
jcd - The connection to use
Throws:
PlatformException - If the target database cannot be handled

getConnection

JdbcConnectionDescriptor getConnection()
Returns the connection descriptor used by this handling object.

Returns:
The connection descriptor

addDBDefinitionFiles

void addDBDefinitionFiles(String srcDir,
                          String listOfFilenames)
                          throws IOException
Adds db definition files to use.

Parameters:
srcDir - The directory containing the files
listOfFilenames - The filenames in a comma-separated list
Throws:
IOException

addDBDefinitionFile

void addDBDefinitionFile(InputStream inputStream)
                         throws IOException
Adds an input streams containg part of the db definition to use.

Parameters:
schemataStreams - Input streams
Throws:
IOException

createDB

void createDB()
              throws PlatformException
Creates the database.

Throws:
PlatformException - If some error occurred

initDB

void initDB()
            throws PlatformException
Creates the tables according to the schema files.

Throws:
PlatformException - If some error occurred


Copyright © 2007-2012 The Kuali Foundation. All Rights Reserved.