net.sf.bloof.db
Class PostgresControl

java.lang.Object
  |
  +--net.sf.bloof.db.PostgresControl

public class PostgresControl
extends java.lang.Object

This class controls the access to a Postgres database

Version:
$Id: PostgresControl.java,v 1.8 2003/09/06 08:35:09 pekacki Exp $
Author:
Lukasz Pekacki

Field Summary
static java.lang.String MY_URL_PREFIX
          Name and prefix of the Database
static java.lang.String NAME
          Name and prefix of the Database
 
Constructor Summary
PostgresControl()
           
 
Method Summary
static void close()
          Closes the database, freeing resources
static java.sql.Connection create(DbAccess aDbAccess)
          Creates a new McKoi SQL Database
static void createIndices()
          Create indices on the databaes for faster processing
static boolean isMyUrl(java.lang.String aDbUrl)
          Returns true if the given String has the prefix of this Database JDBC URL
static java.sql.Connection open(DbAccess aDbAccess)
          Starts a local internal McKoi SQL Database; if the database does not exist yet, it will be created
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MY_URL_PREFIX

public static final java.lang.String MY_URL_PREFIX
Name and prefix of the Database

See Also:
Constant Field Values

NAME

public static final java.lang.String NAME
Name and prefix of the Database

See Also:
Constant Field Values
Constructor Detail

PostgresControl

public PostgresControl()
Method Detail

close

public static void close()
                  throws java.sql.SQLException,
                         java.io.IOException
Closes the database, freeing resources

Throws:
java.sql.SQLException - on error
java.io.IOException - on error

create

public static java.sql.Connection create(DbAccess aDbAccess)
                                  throws java.sql.SQLException,
                                         java.io.IOException
Creates a new McKoi SQL Database

Parameters:
aDbAccess - access info for database
Returns:
Connection to the database
Throws:
java.sql.SQLException - if error on database connect occurs
java.io.IOException - if error on file access

createIndices

public static void createIndices()
                          throws java.io.IOException
Create indices on the databaes for faster processing

Throws:
java.io.IOException - on access error to ddl file

isMyUrl

public static boolean isMyUrl(java.lang.String aDbUrl)
Returns true if the given String has the prefix of this Database JDBC URL

Parameters:
aDbUrl - URL to check
Returns:
true if the given String has the prefix of this Database JDBC URL

open

public static java.sql.Connection open(DbAccess aDbAccess)
                                throws java.sql.SQLException
Starts a local internal McKoi SQL Database; if the database does not exist yet, it will be created

Parameters:
aDbAccess - access info for database
Returns:
Connection to the database
Throws:
java.sql.SQLException - if error on database connect occurs


Copyright © 2003 bloof@Sourceforge. All Rights Reserved.