Package org.bridgedb.sql
Class SqlFactory
- java.lang.Object
-
- org.bridgedb.utils.ConfigReader
-
- org.bridgedb.sql.SqlFactory
-
public class SqlFactory extends ConfigReader
Finds the SQL Configuration file and uses it to open the database with the correct database name, user name and password.See load() for where and in which order the file will be looked for.
- Author:
- Christian
-
-
Field Summary
Fields Modifier and Type Field Description static StringMYSQL_ENGINE_PROPERTYstatic StringSQL_DATABASE_PROPERTYstatic StringSQL_PASSWORD_PROPERTYstatic StringSQL_PORT_PROPERTYName of the file assumed to hold the SQl configurations.static StringSQL_USER_PROPERTYstatic StringTEST_SQL_DATABASE_PROPERTYstatic StringTEST_SQL_PASSWORD_PROPERTYstatic StringTEST_SQL_USER_PROPERTY-
Fields inherited from class org.bridgedb.utils.ConfigReader
CONFIG_FILE_NAME, CONFIG_FILE_PATH_PROPERTY, CONFIG_FILE_PATH_SOURCE_PROPERTY, LOCAL_FILE_NAME, LOG_PROPERTIES_FILE, loggerSetup, useTest
-
-
Constructor Summary
Constructors Constructor Description SqlFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stringconfigs()static SQLAccesscreateASQLAccess(String database)Create a wrapper around the live SQL Database, using the database name, user name and password found in the config file.static SQLAccesscreateTheSQLAccess()Create a wrapper around the live SQL Database, using the database name, user name and password found in the config file.static StringengineSetting()static voidsetUseMySQL(boolean forceMySQL)-
Methods inherited from class org.bridgedb.utils.ConfigReader
configureLogger, getInputStream, getProperties, getProperties, getProperty, inTestMode, logToConsole, useTest
-
-
-
-
Field Detail
-
SQL_PORT_PROPERTY
public static final String SQL_PORT_PROPERTY
Name of the file assumed to hold the SQl configurations.- See Also:
- Constant Field Values
-
SQL_USER_PROPERTY
public static final String SQL_USER_PROPERTY
- See Also:
- Constant Field Values
-
SQL_PASSWORD_PROPERTY
public static final String SQL_PASSWORD_PROPERTY
- See Also:
- Constant Field Values
-
SQL_DATABASE_PROPERTY
public static final String SQL_DATABASE_PROPERTY
- See Also:
- Constant Field Values
-
TEST_SQL_DATABASE_PROPERTY
public static final String TEST_SQL_DATABASE_PROPERTY
- See Also:
- Constant Field Values
-
TEST_SQL_USER_PROPERTY
public static final String TEST_SQL_USER_PROPERTY
- See Also:
- Constant Field Values
-
TEST_SQL_PASSWORD_PROPERTY
public static final String TEST_SQL_PASSWORD_PROPERTY
- See Also:
- Constant Field Values
-
MYSQL_ENGINE_PROPERTY
public static final String MYSQL_ENGINE_PROPERTY
- See Also:
- Constant Field Values
-
-
Method Detail
-
createTheSQLAccess
public static SQLAccess createTheSQLAccess() throws BridgeDBException
Create a wrapper around the live SQL Database, using the database name, user name and password found in the config file.- Returns:
- sqlAccess - a wrapper around the individual SQL database drivers
- Throws:
BridgeDBException- - if something goes wrong with the connection
-
createASQLAccess
public static SQLAccess createASQLAccess(String database) throws BridgeDBException
Create a wrapper around the live SQL Database, using the database name, user name and password found in the config file.- Parameters:
database- - the name of the database- Returns:
- sqlAccess - a wrapper around the individual SQL database drivers
- Throws:
BridgeDBException- - if something goes wrong with the connection
-
setUseMySQL
public static void setUseMySQL(boolean forceMySQL)
-
configs
public static String configs()
-
engineSetting
public static String engineSetting()
-
-