|
||||||||||
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 java.lang.String |
DEFAULT_PROPERTYSTORE
|
static java.lang.String |
REGEX
|
static java.lang.String |
VARCHAR_LENGTH
|
Constructor Summary | |
---|---|
StoreFactory()
|
Method Summary | |
---|---|
static void |
debugmsg(java.lang.String msg)
|
static java.lang.Object |
deserializeObject(java.lang.Object o)
Deserializes a byte array into a Java object. |
static boolean |
dropTable(java.sql.Connection connection,
java.lang.String table)
Drops a table in the database associated with connection. |
static java.lang.Exception |
dropTable(java.lang.String tableName)
Drops a table in the default database. |
static java.sql.Connection |
getConnection()
Returns a connection object to the default database. |
static java.sql.Connection |
getConnection(boolean autoCommit)
Returns a connection object to the default database using the default username/password. |
static java.sql.Connection |
getConnection(java.lang.String database)
Returns a connection object to the named database with AutoCommit set to TRUE using the default username/password. |
static java.sql.Connection |
getConnection(java.lang.String database,
boolean autoCommit)
Returns a connection object to the named database with the default username/password. |
static java.sql.Connection |
getConnection(java.lang.String database,
boolean autoCommit,
java.lang.String user,
java.lang.String password,
java.util.Properties info)
Returns a connection to the named database. |
static java.lang.String |
getDbHost()
|
static java.lang.String |
getDbPort()
|
static java.lang.String |
getDefaultDatabase()
|
static PropertyStore |
getDefaultPropertyStore()
Returns the default property store. |
static DeltaStore |
getDeltaStore(java.lang.String identifier,
boolean isRestarting)
Returns the DeltaStore with identifier |
static java.lang.String |
getJdbcDriver()
|
static java.lang.String |
getJdbcPassword()
|
static java.lang.String |
getJdbcURL()
|
static java.lang.String |
getJdbcUser()
|
static java.lang.String |
getProperty(java.lang.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(java.lang.String name)
Returns the PropertyStore identified by name. |
static java.lang.String |
getSystemDatabase()
Returns the default system database name |
static java.lang.String |
getSystemDatabaseURL()
Returns the SystemStore JDBC URL. |
static java.util.Vector<java.lang.String> |
getTables(java.sql.Connection connection,
java.lang.String table)
|
static java.lang.String |
getVarcharLength()
|
static boolean |
isDerbyDriver(java.lang.String driver)
|
static boolean |
isDerbyNetworkDriver(java.lang.String driver)
Determines if the passed driver is a Derby Network Driver. |
static boolean |
isMSSQLDriver(java.lang.String driver)
|
static void |
logmsg(java.lang.String msg)
|
static void |
releaseDB(java.lang.String id)
|
static void |
retainDB(java.lang.String id,
java.lang.String db)
|
static byte[] |
serializeObject(java.lang.Object obj)
Serializes an object to a byte array. |
static void |
setDerbyUserPassword(java.lang.String user,
java.lang.String password)
|
static void |
shutdown()
Shuts down all open databases. |
static void |
startDerbyServer(java.lang.String hostname,
java.lang.String portNo,
boolean sysIBM)
Start the networked Derby Server. |
static void |
stopDerbyServer(java.lang.String hostname,
int port)
|
static boolean |
tableExists(java.sql.Connection connection,
java.lang.String table)
Checks if a table is accessible in the database. |
static boolean |
verifyTable(java.sql.Connection connection,
java.lang.String table,
java.util.Vector<java.lang.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 java.lang.String DEFAULT_PROPERTYSTORE
public static final java.lang.String REGEX
public static final java.lang.String VARCHAR_LENGTH
Constructor Detail |
---|
public StoreFactory()
Method Detail |
---|
public static PropertyStore getDefaultPropertyStore() throws java.lang.Exception
java.lang.Exception
public static PropertyStore getPropertyStore(java.lang.String name) throws java.lang.Exception
name
- The property store name
java.lang.Exception
public static DeltaStore getDeltaStore(java.lang.String identifier, boolean isRestarting) throws java.lang.Exception
identifier
- The delta table identity/tablenameisRestarting
- True if the delta is opened in restart mode
java.lang.Exception
public static java.lang.String getSystemDatabaseURL()
public static java.lang.String getSystemDatabase()
public static java.sql.Connection getConnection() throws java.lang.Exception
java.lang.Exception
public static java.sql.Connection getConnection(boolean autoCommit) throws java.lang.Exception
autoCommit
- The auto-commit flag
java.lang.Exception
public static java.sql.Connection getConnection(java.lang.String database) throws java.lang.Exception
database
- The database name
java.lang.Exception
public static java.sql.Connection getConnection(java.lang.String database, boolean autoCommit) throws java.lang.Exception
database
- The database nameautoCommit
- The auto-commit flag
java.lang.Exception
public static java.sql.Connection getConnection(java.lang.String database, boolean autoCommit, java.lang.String user, java.lang.String password, java.util.Properties info) throws java.lang.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.
java.lang.Exception
public static void setDerbyUserPassword(java.lang.String user, java.lang.String password)
public static boolean dropTable(java.sql.Connection connection, java.lang.String table)
connection
- The connection object obtained by getConnection()table
- The table to droppublic static boolean verifyTable(java.sql.Connection connection, java.lang.String table, java.util.Vector<java.lang.String> sql) throws java.lang.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
java.lang.Exception
public static boolean tableExists(java.sql.Connection connection, java.lang.String table) throws java.lang.Exception
connection
- The connection object obtained by getConnection(). If NULL, a
connection to the default table is obtained.table
- The table name to verify
java.lang.Exception
public static java.util.Vector<java.lang.String> getTables(java.sql.Connection connection, java.lang.String table) throws java.lang.Exception
java.lang.Exception
public static void shutdown()
public static java.lang.Exception dropTable(java.lang.String tableName)
tableName
- The name of the table to drop.public static byte[] serializeObject(java.lang.Object obj) throws java.lang.Exception
obj
- The object to serialize
java.lang.Exception
public static java.lang.Object deserializeObject(java.lang.Object o) throws java.lang.Exception
o
- The byte array with the serialized Java object
java.lang.Exception
public static void retainDB(java.lang.String id, java.lang.String db)
public static void releaseDB(java.lang.String id)
public static void logmsg(java.lang.String msg)
public static void debugmsg(java.lang.String msg)
public static void startDerbyServer(java.lang.String hostname, java.lang.String portNo, boolean sysIBM) throws java.lang.Exception
hostname
- portNo
- sysIBM
-
java.lang.Exception
public static void stopDerbyServer(java.lang.String hostname, int port) throws java.lang.Exception
java.lang.Exception
public static boolean isDerbyNetworkDriver(java.lang.String driver)
public static boolean isDerbyDriver(java.lang.String driver)
public static boolean isMSSQLDriver(java.lang.String driver)
public static java.lang.String getDefaultDatabase()
public static java.lang.String getJdbcDriver()
public static java.lang.String getJdbcURL()
public static java.lang.String getJdbcUser()
public static java.lang.String getJdbcPassword()
public static java.lang.String getVarcharLength()
public static java.lang.String getDbHost()
public static java.lang.String getDbPort()
public static java.lang.String getProperty(java.lang.String key)
key
- the property's indentifier
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |