org.figure8.join.core.setup
Class DatabaseDetails

java.lang.Object
  extended by org.figure8.join.core.setup.DatabaseDetails

public class DatabaseDetails
extends java.lang.Object

Wrapper for common database properties.

Version:
$Revision: 1.3 $
Author:
Laurent Broudoux

Field Summary
protected static org.apache.commons.logging.Log log
          Get a commons logger.
static java.lang.String OTHER_DB
          Constant for other, no officially supported database.
static java.lang.String[] SUPPORTED_DB
          Array of supported database names.
 
Constructor Summary
DatabaseDetails()
          Creates a new instance of DatabaseDetails
 
Method Summary
 java.lang.String getDatabaseUrl()
           
static DatabaseDetails getDefault(java.lang.String database)
          Get a default details wrapping object for database name.
protected static java.util.Properties getDefaultProperties(java.lang.String database)
          Loading default properties for database from properties file in classpath
 java.lang.String getDialect()
           
 java.lang.String getDriverClassname()
           
 java.lang.String getPassword()
           
 int getPoolSize()
           
 java.lang.String getUsername()
           
static boolean isSupportedDatabase(java.lang.String database)
          Tell if the given database name is officialy supported by Join.
 void setDatabaseUrl(java.lang.String url)
           
 void setDialect(java.lang.String dialect)
           
 void setDriverClassname(java.lang.String driver)
           
 void setPassword(java.lang.String pwd)
           
 void setPoolSize(int size)
           
 void setUsername(java.lang.String user)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static org.apache.commons.logging.Log log
Get a commons logger.


OTHER_DB

public static final java.lang.String OTHER_DB
Constant for other, no officially supported database.

See Also:
Constant Field Values

SUPPORTED_DB

public static final java.lang.String[] SUPPORTED_DB
Array of supported database names.

Constructor Detail

DatabaseDetails

public DatabaseDetails()
Creates a new instance of DatabaseDetails

Method Detail

setUsername

public void setUsername(java.lang.String user)
Parameters:
user - Name of user for connecting db

getUsername

public java.lang.String getUsername()
Returns:
Get the user for connecting db

setPassword

public void setPassword(java.lang.String pwd)
Parameters:
pwd - Password for connecting db

getPassword

public java.lang.String getPassword()
Returns:
Get the password for connecting db

setDatabaseUrl

public void setDatabaseUrl(java.lang.String url)
Parameters:
url - URL for connecting to db

getDatabaseUrl

public java.lang.String getDatabaseUrl()
Returns:
Get the URL for connecting to db

setDriverClassname

public void setDriverClassname(java.lang.String driver)
Parameters:
driver - JDBC driver classname for connecting db

getDriverClassname

public java.lang.String getDriverClassname()
Returns:
Get the classname of JDBC driver for connecting

setPoolSize

public void setPoolSize(int size)
Parameters:
size - Size of connection pool (if handled by application)

getPoolSize

public int getPoolSize()
Returns:
Get the size of the connection pool

setDialect

public void setDialect(java.lang.String dialect)
Parameters:
dialect - SQL dialect for querying db

getDialect

public java.lang.String getDialect()
Returns:
Get the SQL dialect for querying db

getDefault

public static DatabaseDetails getDefault(java.lang.String database)
Get a default details wrapping object for database name.

Parameters:
database - Name of the database to get defaults for
Returns:
An instance of DatabaseDetails

isSupportedDatabase

public static boolean isSupportedDatabase(java.lang.String database)
Tell if the given database name is officialy supported by Join.

Parameters:
database - Name of the database to test (ex: "mysql")
Returns:
true if supportd, false otherwise

getDefaultProperties

protected static java.util.Properties getDefaultProperties(java.lang.String database)
Loading default properties for database from properties file in classpath

Parameters:
database - Name of database to load properties for

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
Returns:
Get the string representation of this details


Copyright © 2005-2008 Join. All Rights Reserved.