org.apache.ojb.broker.platforms
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(java.io.InputStream inputStream)
          Adds an input streams containg part of the db definition to use.
 void addDBDefinitionFiles(java.lang.String srcDir, java.lang.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(java.lang.String dir)
          Sets the working directory.
 

Method Detail

setWorkDir

public void setWorkDir(java.lang.String dir)
                throws java.io.IOException
Sets the working directory.

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

setConnection

public 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

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

Returns:
The connection descriptor

addDBDefinitionFiles

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

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

addDBDefinitionFile

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

Throws:
java.io.IOException

createDB

public void createDB()
              throws PlatformException
Creates the database.

Throws:
PlatformException - If some error occurred

initDB

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

Throws:
PlatformException - If some error occurred


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14