Class SQLConnectionImpl
- java.lang.Object
-
- edu.uiuc.ncsa.security.storage.sql.SQLConnectionImpl
-
- All Implemented Interfaces:
ConnectionParameters
- Direct Known Subclasses:
AdminConnectionParameters
,DerbyConnectionParameters
,H2ConnectionParameters
,MariaDBConnectionParameters
,MySQLConnectionParameters
,PostgresConnectionParameters
public abstract class SQLConnectionImpl extends Object implements ConnectionParameters
General connection parameters object for a relational database. These properties are standard for every such database, the only difference really is how the JDBC urls are made, which is vendor specific.Created by Jeff Gaynor
on Jun 23, 2010 at 8:01:59 AM
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
SQLConnectionImpl(String username, String password, String databaseName, String schema, String host, int port, String jdbcDriver, boolean useSSL, String parameters)
SQLConnectionImpl(net.sf.json.JSONObject jsonObject)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected String
addParameters(String jdbcURL)
Add parameters from the configuration file if they exist.boolean
equals(Object obj)
void
fromJSON(net.sf.json.JSONObject json)
Populate this from the JSON object.String
getDatabaseName()
String
getParameters()
String
getPassword()
String
getSchema()
String
getUsername()
protected void
init()
net.sf.json.JSONObject
toJSON()
Turn this configuration into a JSON object.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface edu.uiuc.ncsa.security.storage.sql.ConnectionParameters
getJdbcUrl
-
-
-
-
Method Detail
-
addParameters
protected String addParameters(String jdbcURL)
Add parameters from the configuration file if they exist. The parameter string is of the formkey0=value0&apm;key1=value1&apm;key2=value2...
NOTE: this method does not set the ssl connection parameter -- tjhat should be done before invoking this method because that is very vendor specific. This method passes along whatever parameters to the driver the user needs or skips them if there are none.- Parameters:
jdbcURL
-- Returns:
-
getParameters
public String getParameters()
-
getUsername
public String getUsername()
- Specified by:
getUsername
in interfaceConnectionParameters
-
init
protected void init()
-
getPassword
public String getPassword()
-
getDatabaseName
public String getDatabaseName()
-
getSchema
public String getSchema()
-
toJSON
public net.sf.json.JSONObject toJSON()
Turn this configuration into a JSON object. This presupposed that this has been created already.- Returns:
-
fromJSON
public void fromJSON(net.sf.json.JSONObject json)
Populate this from the JSON object. This will overwrite any existing values.- Parameters:
json
-
-
-