Package org.hsqldb.util
Class RCData
java.lang.Object
org.hsqldb.util.RCData
All the info we need to connect up to a database.
- Author:
- Blaine Simpson unsaved@users
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionCreates a RCDataObject by looking up the given key in the given authentication file.RCData(String id, String url, String username, String password, String driver, String charset, String truststore) Convenience constructor for backward compatibility.RCData(String id, String url, String username, String password, String driver, String charset, String truststore, String libpath) Creates a newRCDataobject. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringexpandSysPropVars(String inString) Gets a JDBC Connection using the data of this RCData object.getConnection(String curDriver, String curCharset, String curTrustStore) Gets a JDBC Connection using the data of this RCData object with specified override elementsvoidreport()Just for testing and debugging.voidsetDefaultJdbcDriver(String defaultJdbcDriverName)
-
Field Details
-
DEFAULT_JDBC_DRIVER
- See Also:
-
-
Constructor Details
-
RCData
Creates a RCDataObject by looking up the given key in the given authentication file.- Parameters:
file- File containing the authentication information.dbKey- Key to look up in the file.- Throws:
Exception
-
RCData
public RCData(String id, String url, String username, String password, String driver, String charset, String truststore) throws Exception Convenience constructor for backward compatibility.- Throws:
Exception- See Also:
-
RCData
public RCData(String id, String url, String username, String password, String driver, String charset, String truststore, String libpath) throws Exception Creates a new
RCDataobject.The parameters driver, charset, truststore, and libpath are optional. Setting these parameters to
NULLwill set them to their default values.- Parameters:
id- The identifier for these connection settingsurl- The URL of the database to connect tousername- The username to log in aspassword- The password of the usernamedriver- The JDBC driver to usecharset- The character set to usetruststore- The trust store to uselibpath- The JDBC library to add to CLASSPATH- Throws:
Exception- if the a non-optional parameter is set toNULL
-
-
Method Details
-
setDefaultJdbcDriver
-
getDefaultJdbcDriverName
-
report
public void report()Just for testing and debugging. N.b. this echoes passwords! -
getConnection
public Connection getConnection() throws ClassNotFoundException, InstantiationException, IllegalAccessException, SQLException, MalformedURLExceptionGets a JDBC Connection using the data of this RCData object.- Returns:
- New JDBC Connection
- Throws:
ClassNotFoundExceptionInstantiationExceptionIllegalAccessExceptionSQLExceptionMalformedURLException
-
getConnection
public Connection getConnection(String curDriver, String curCharset, String curTrustStore) throws ClassNotFoundException, InstantiationException, IllegalAccessException, MalformedURLException, SQLException Gets a JDBC Connection using the data of this RCData object with specified override elements- Returns:
- New JDBC Connection
- Throws:
ClassNotFoundExceptionInstantiationExceptionIllegalAccessExceptionMalformedURLExceptionSQLException
-
expandSysPropVars
-