Package com.anylogic.engine.database
- java.lang.Object
- com.anylogic.engine.database.UtilitiesDatabase
public class UtilitiesDatabase extends Object
Constructor | Description |
---|---|
UtilitiesDatabase() |
Modifier and Type | Method | Description |
---|---|---|
static void | copyDatabaseTable | |
static void | copyDatabaseTable | |
static void | copyDatabaseTables | |
static void | exportTables | |
static String | getIdentifierQuoteString | |
static boolean | isInt |
Determines whether provided double value is integer or not.
|
static boolean | isMariaDb | |
static boolean | isMicrosoftAccess | |
static boolean | isOracleDB | |
static boolean | logIfNeeded |
Logs information to database
|
static boolean | logIfNeeded |
Logs information to database
|
static String | toStringDB | |
static String | trimTableName |
public UtilitiesDatabase()
@AnyLogicInternalAPI public static String getIdentifierQuoteString(Connection connection)
@AnyLogicInternalAPI public static void exportTables(ProgressConsumer monitor, Connection sourceDatabase, Connection targetDatabase, Collection<String> sqlStatements, List<String> sourceNames)
@AnyLogicInternalAPI public static String trimTableName(String s)
@AnyLogicInternalAPI public static void copyDatabaseTables(ProgressConsumer monitor, Connection sourceConnection, Connection targetConnection, List<String> sourceTableNames, List<String> targetTableNames, boolean clearTargetTable, boolean autoCommit)
@AnyLogicInternalAPI public static void copyDatabaseTable(Connection sourceConnection, Connection targetConnection, String sourceTableName, String targetTableName)
@AnyLogicInternalAPI public static void copyDatabaseTable(Connection sourceConnection, Connection targetConnection, String sourceTableName, String targetTableName, boolean clearTargetTable, boolean autoCommit) throws SQLException
- Throws:
SQLException
@AnyLogicInternalAPI public static boolean isInt(double value)
Determines whether provided double value is integer or not.
The method is implemented for importing Excel data which can already have rounding errors
because of chosen cell type (e.g. 'General' for numeric data instead of 'Number'). That is why
no comparison with epsilon is used.
- Parameters:
value
- floating point-number- Returns:
- true if value is integer, false if double
@AnyLogicInternalAPI public static boolean logIfNeeded(Utilities agent, LoggingType loggingType, Supplier<ILogEntry> logEntrySupplier)
Logs information to database
- Returns:
true
if log entry has been created and processed,false
e.g. if logging settings don't allow logging
@AnyLogicInternalAPI public static boolean logIfNeeded(Utilities agent, LoggingType loggingType, boolean staticEntry, Supplier<ILogEntry> logEntrySupplier)
Logs information to database
- Parameters:
loggingType
- type of loggingstaticEntry
-true
if the log entry doesn't depend on a particular object instance (some structural entry, e.g. Agent type name)- Returns:
true
if log entry has been created and processed,false
e.g. if logging settings don't allow logging
public static String toStringDB(Object value)
public static boolean isMicrosoftAccess(Connection connection) throws SQLException
- Throws:
SQLException
public static boolean isOracleDB(Connection connection) throws SQLException
- Throws:
SQLException
public static boolean isMariaDb(Connection connection) throws SQLException
- Throws:
SQLException