|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.store.StoreFactory
public class StoreFactory
Field Summary | |
---|---|
static String |
DEFAULT_PROPERTYSTORE
|
static String |
JDBC_DRIVER_DB2
|
static String |
JDBC_DRIVER_DERBY_EMB
|
static String |
JDBC_DRIVER_DERBY_NET
|
static String |
JDBC_DRIVER_MSSQL
|
static String |
JDBC_DRIVER_ORACLE
|
static String |
JDBC_DRIVER_SOLID
|
static String |
REGEX
|
static String |
VARCHAR_LENGTH
|
Constructor Summary | |
---|---|
StoreFactory()
|
Method Summary | |
---|---|
static void |
debugmsg(String msg)
|
static Object |
deserializeObject(Object o)
Deserializes a byte array into a Java object. |
static boolean |
dropTable(Connection connection,
String table)
Drops a table in the database associated with connection. |
static Exception |
dropTable(String tableName)
Drops a table in the default database. |
static Connection |
getConnection()
Returns a connection object to the default database. |
static Connection |
getConnection(boolean autoCommit)
Returns a connection object to the default database using the default username/password. |
static Connection |
getConnection(String database)
Returns a connection object to the named database with AutoCommit set to TRUE using the default username/password. |
static Connection |
getConnection(String database,
boolean autoCommit)
Returns a connection object to the named database with the default username/password. |
static Connection |
getConnection(String database,
boolean autoCommit,
String user,
String password,
Properties info)
Returns a connection to the named database. |
static String |
getDbHost()
|
static String |
getDbPort()
|
static String |
getDefaultDatabase()
|
static PropertyStore |
getDefaultPropertyStore()
Returns the default property store. |
static DeltaStore |
getDeltaStore(String identifier,
boolean isRestarting)
Returns the DeltaStore with identifier |
static String |
getJdbcDriver()
|
static String |
getJdbcPassword()
|
static String |
getJdbcURL()
|
static String |
getJdbcUser()
|
static String |
getProperty(String key)
This method will look at the configuration in the caller's thread (RS.getServer) to see if it overrides the default settings from global/solution properties. |
static PropertyStore |
getPropertyStore(String name)
Returns the PropertyStore identified by name. |
static String |
getSysStoreCreateStmtByDriver(String driver)
This method returns the proper 'CREATE TABLE' statement for the System Store Connector based on the specified JDBC driver name. |
static String |
getSystemDatabase()
Returns the default system database name |
static String |
getSystemDatabaseURL()
Returns the SystemStore JDBC URL. |
static Vector<String> |
getTables(Connection connection,
String table)
|
static String |
getVarcharLength()
|
static boolean |
isDerbyDriver(String driver)
|
static boolean |
isDerbyNetworkDriver(String driver)
Determines if the passed driver is a Derby Network Driver. |
static boolean |
isMSSQLDriver(String driver)
|
static void |
logmsg(String msg)
|
static void |
releaseDB(String id)
|
static void |
retainDB(String id,
String db)
|
static byte[] |
serializeObject(Object obj)
Serializes an object to a byte array. |
static void |
setDerbyUserPassword(String user,
String password)
|
static void |
shutdown()
Shuts down all open databases. |
static void |
startDerbyServer(String hostname,
String portNo,
boolean sysIBM)
Start the networked Derby Server. |
static void |
stopDerbyServer(String hostname,
int port)
|
static boolean |
tableExists(Connection connection,
String table)
Checks if a table is accessible in the database. |
static boolean |
verifyTable(Connection connection,
String table,
Vector<String> sql)
Verifies that a table is accessible in the database. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String JDBC_DRIVER_DERBY_NET
public static final String JDBC_DRIVER_DERBY_EMB
public static final String JDBC_DRIVER_DB2
public static final String JDBC_DRIVER_ORACLE
public static final String JDBC_DRIVER_MSSQL
public static final String JDBC_DRIVER_SOLID
public static final String DEFAULT_PROPERTYSTORE
public static final String REGEX
public static final String VARCHAR_LENGTH
Constructor Detail |
---|
public StoreFactory()
Method Detail |
---|
public static PropertyStore getDefaultPropertyStore() throws Exception
Exception
public static PropertyStore getPropertyStore(String name) throws Exception
name
- The property store name
Exception
public static DeltaStore getDeltaStore(String identifier, boolean isRestarting) throws Exception
identifier
- The delta table identity/tablenameisRestarting
- True if the delta is opened in restart mode
Exception
public static String getSystemDatabaseURL()
public static String getSystemDatabase()
public static Connection getConnection() throws Exception
Exception
public static Connection getConnection(boolean autoCommit) throws Exception
autoCommit
- The auto-commit flag
Exception
public static Connection getConnection(String database) throws Exception
database
- The database name
Exception
public static Connection getConnection(String database, boolean autoCommit) throws Exception
database
- The database nameautoCommit
- The auto-commit flag
Exception
public static Connection getConnection(String database, boolean autoCommit, String user, String password, Properties info) throws Exception
database
- If the value starts with "jdbc:" then it is used asis to
obtain a connection object. Otherwise, this method prepends
the JDBC_URL setting from the global.properties file and
appends ";create=true". When prepending JDBC_URL it is assumed
that Derby is used.autoCommit
- The auto commit flag set on the connection objectuser
- The usernamepassword
- The passwordinfo
- If specified, this method will use the database asis (e.g. no
prepend/append) combined with this parameter to obtain a
connection object. The info object should contain fields for
user and pass and other related parameters to the driver.
Exception
public static void setDerbyUserPassword(String user, String password)
public static boolean dropTable(Connection connection, String table)
connection
- The connection object obtained by getConnection()table
- The table to droppublic static boolean verifyTable(Connection connection, String table, Vector<String> sql) throws Exception
connection
- The connection object obtained by getConnection(). If NULL, a
connection to the default table is obtained.table
- The table name to verifysql
- A vector of SQL statements to create the table if it does not
exist
Exception
public static boolean tableExists(Connection connection, String table) throws Exception
connection
- The connection object obtained by getConnection(). If NULL, a
connection to the default table is obtained.table
- The table name to verify
Exception
public static Vector<String> getTables(Connection connection, String table) throws Exception
Exception
public static void shutdown()
public static Exception dropTable(String tableName)
tableName
- The name of the table to drop.public static byte[] serializeObject(Object obj) throws Exception
obj
- The object to serialize
Exception
public static Object deserializeObject(Object o) throws Exception
o
- The byte array with the serialized Java object
Exception
public static void retainDB(String id, String db)
public static void releaseDB(String id)
public static void logmsg(String msg)
public static void debugmsg(String msg)
public static void startDerbyServer(String hostname, String portNo, boolean sysIBM) throws Exception
hostname
- portNo
- sysIBM
-
Exception
public static void stopDerbyServer(String hostname, int port) throws Exception
Exception
public static boolean isDerbyNetworkDriver(String driver)
public static boolean isDerbyDriver(String driver)
public static boolean isMSSQLDriver(String driver)
public static String getDefaultDatabase()
public static String getJdbcDriver()
public static String getJdbcURL()
public static String getJdbcUser()
public static String getJdbcPassword()
public static String getVarcharLength()
public static String getDbHost()
public static String getDbPort()
public static String getSysStoreCreateStmtByDriver(String driver)
driver
- java class name of the JDBC driver
null
if the driver is not recognized.public static String getProperty(String key)
key
- the property's indentifier
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |