org.riverock.dbrevision.db
Class DatabaseManager
java.lang.Object
org.riverock.dbrevision.db.DatabaseManager
public final class DatabaseManager
- extends Object
User: Admin
Date: Aug 30, 2003
Time: 5:07:17 PM
$Id: DatabaseManager.java 1141 2006-12-14 14:43:29Z serg_main $
Method Summary |
static void |
addPrimaryKey(Database db_,
DbTable table,
DbPrimaryKey pk)
|
static boolean |
checkDefaultTimestamp(String val)
Check what field's default value is default timestamp(date) for bd column
For example for Oracle value is 'SYSDATE' |
static void |
copyData(Database db_,
DbTable fieldsList,
String sourceTable,
String targetTableName)
|
static void |
createWithReplaceAllView(Database adapter,
DbSchema millSchema)
|
static void |
duplicateTable(Database db_,
DbTable srcTable,
String targetTableName)
|
static DbSchema |
getDbStructure(Database adapter)
|
static DbSchema |
getDbStructure(Database adapter,
boolean isOnlyCurrent)
|
static DbField |
getFieldFromStructure(DbSchema schema,
String tableName,
String fieldName)
|
static List<Long> |
getIdByList(Database adapter,
String sql,
Object[] param)
|
static List<Long> |
getLongValueList(Database db,
String sql,
Object[] params,
int[] types)
|
static DbTable |
getTableFromStructure(DbSchema schema,
String tableName)
|
static DbView |
getViewFromStructure(DbSchema schema,
String viewName)
|
static List<DbView> |
getViewList(Connection conn,
String schemaPattern,
String tablePattern)
|
static boolean |
isFieldExists(DbSchema schema,
DbTable table,
DbField field)
|
static boolean |
isSkipTable(String table)
|
static boolean |
isTableExists(DbSchema schema,
DbTable table)
|
static int |
sqlTypesMapping(String type)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DatabaseManager
public DatabaseManager()
addPrimaryKey
public static void addPrimaryKey(Database db_,
DbTable table,
DbPrimaryKey pk)
copyData
public static void copyData(Database db_,
DbTable fieldsList,
String sourceTable,
String targetTableName)
duplicateTable
public static void duplicateTable(Database db_,
DbTable srcTable,
String targetTableName)
getFieldFromStructure
public static DbField getFieldFromStructure(DbSchema schema,
String tableName,
String fieldName)
getTableFromStructure
public static DbTable getTableFromStructure(DbSchema schema,
String tableName)
getViewFromStructure
public static DbView getViewFromStructure(DbSchema schema,
String viewName)
isFieldExists
public static boolean isFieldExists(DbSchema schema,
DbTable table,
DbField field)
isTableExists
public static boolean isTableExists(DbSchema schema,
DbTable table)
getDbStructure
public static DbSchema getDbStructure(Database adapter)
getDbStructure
public static DbSchema getDbStructure(Database adapter,
boolean isOnlyCurrent)
createWithReplaceAllView
public static void createWithReplaceAllView(Database adapter,
DbSchema millSchema)
getViewList
public static List<DbView> getViewList(Connection conn,
String schemaPattern,
String tablePattern)
isSkipTable
public static boolean isSkipTable(String table)
checkDefaultTimestamp
public static boolean checkDefaultTimestamp(String val)
- Check what field's default value is default timestamp(date) for bd column
For example for Oracle value is 'SYSDATE'
- Parameters:
val
- value for DEFAULT_DATE_VALUES
- Returns:
- true, if value is date, otherwise false
sqlTypesMapping
public static int sqlTypesMapping(String type)
getLongValueList
public static List<Long> getLongValueList(Database db,
String sql,
Object[] params,
int[] types)
getIdByList
public static List<Long> getIdByList(Database adapter,
String sql,
Object[] param)
Copyright © 2008 Riverock community. All Rights Reserved.