org.hsqldb.util

Class RCData

public class RCData extends Object

All the info we need to connect up to a database.

Author: Blaine Simpson unsaved@users

Field Summary
static StringDEFAULT_JDBC_DRIVER
Constructor Summary
RCData(File file, String dbKey)
Creates 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 new RCData object.

Method Summary
static StringexpandSysPropVars(String inString)
ConnectiongetConnection()
Gets a JDBC Connection using the data of this RCData object.
ConnectiongetConnection(String curDriver, String curCharset, String curTrustStore)
Gets a JDBC Connection using the data of this RCData object with specified override elements
StringgetDefaultJdbcDriverName()
voidreport()
Just for testing and debugging.
voidsetDefaultJdbcDriver(String defaultJdbcDriverName)

Field Detail

DEFAULT_JDBC_DRIVER

public static final String DEFAULT_JDBC_DRIVER

Constructor Detail

RCData

public RCData(File file, String dbKey)
Creates a RCDataObject by looking up the given key in the given authentication file.

Parameters: dbKey Key to look up in the file. file File containing the authentication information.

RCData

public RCData(String id, String url, String username, String password, String driver, String charset, String truststore)
Convenience constructor for backward compatibility.

See Also: RCData

RCData

public RCData(String id, String url, String username, String password, String driver, String charset, String truststore, String libpath)

Creates a new RCData object.

The parameters driver, charset, truststore, and libpath are optional. Setting these parameters to NULL will set them to their default values.

Parameters: id The identifier for these connection settings url The URL of the database to connect to username The username to log in as password The password of the username driver The JDBC driver to use charset The character set to use truststore The trust store to use libpath The JDBC library to add to CLASSPATH

Throws: Exception if the a non-optional parameter is set to NULL

Method Detail

expandSysPropVars

public static String expandSysPropVars(String inString)

getConnection

public Connection getConnection()
Gets a JDBC Connection using the data of this RCData object.

Returns: New JDBC Connection

getConnection

public Connection getConnection(String curDriver, String curCharset, String curTrustStore)
Gets a JDBC Connection using the data of this RCData object with specified override elements

Returns: New JDBC Connection

getDefaultJdbcDriverName

public String getDefaultJdbcDriverName()

report

public void report()
Just for testing and debugging. N.b. this echoes passwords!

setDefaultJdbcDriver

public void setDefaultJdbcDriver(String defaultJdbcDriverName)
Copyright B) 2001 - 2005 HSQL Development Group. All Rights Reserved.