AnyLogic
Expand
Font size
  • java.lang.Object
    • com.anylogic.engine.database.UtilitiesDatabase

public class UtilitiesDatabase
extends java.lang.Object

Constructor Summary

Constructors 
UtilitiesDatabase()  
Constructor Description

Method Summary

All Methods Static Methods Concrete Methods 
static void copyDatabaseTable​(java.sql.Connection sourceConnection, java.sql.Connection targetConnection, java.lang.String sourceTableName, java.lang.String targetTableName)  
static void copyDatabaseTable​(java.sql.Connection sourceConnection, java.sql.Connection targetConnection, java.lang.String sourceTableName, java.lang.String targetTableName, boolean clearTargetTable, boolean autoCommit)  
static void copyDatabaseTables​(ProgressConsumer monitor, java.sql.Connection sourceConnection, java.sql.Connection targetConnection, java.util.List<java.lang.String> sourceTableNames, java.util.List<java.lang.String> targetTableNames, boolean clearTargetTable, boolean autoCommit)  
static void exportTables​(ProgressConsumer monitor, java.sql.Connection sourceDatabase, java.sql.Connection targetDatabase, java.util.Collection<java.lang.String> sqlStatements, java.util.List<java.lang.String> sourceNames)  
static java.lang.String getIdentifierQuoteString​(java.sql.Connection connection)  
static boolean logIfNeeded​(Utilities agent, LoggingType loggingType, boolean staticEntry, java.util.function.Supplier<ILogEntry> logEntrySupplier)
Logs information to database
static boolean logIfNeeded​(Utilities agent, LoggingType loggingType, java.util.function.Supplier<ILogEntry> logEntrySupplier)
Logs information to database
static java.lang.String toStringDB​(java.lang.Object value)  
static java.lang.String trimTableName​(java.lang.String s)  
Modifier and Type Method Description

Methods inherited from class java.lang.Object

equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

UtilitiesDatabase

public UtilitiesDatabase()

Method Detail

getIdentifierQuoteString

@AnyLogicInternalAPI
public static java.lang.String getIdentifierQuoteString​(java.sql.Connection connection)

exportTables

@AnyLogicInternalAPI
public static void exportTables​(ProgressConsumer monitor,
                                java.sql.Connection sourceDatabase,
                                java.sql.Connection targetDatabase,
                                java.util.Collection<java.lang.String> sqlStatements,
                                java.util.List<java.lang.String> sourceNames)

trimTableName

@AnyLogicInternalAPI
public static java.lang.String trimTableName​(java.lang.String s)

copyDatabaseTables

@AnyLogicInternalAPI
public static void copyDatabaseTables​(ProgressConsumer monitor,
                                      java.sql.Connection sourceConnection,
                                      java.sql.Connection targetConnection,
                                      java.util.List<java.lang.String> sourceTableNames,
                                      java.util.List<java.lang.String> targetTableNames,
                                      boolean clearTargetTable,
                                      boolean autoCommit)

copyDatabaseTable

@AnyLogicInternalAPI
public static void copyDatabaseTable​(java.sql.Connection sourceConnection,
                                     java.sql.Connection targetConnection,
                                     java.lang.String sourceTableName,
                                     java.lang.String targetTableName)

copyDatabaseTable

@AnyLogicInternalAPI
public static void copyDatabaseTable​(java.sql.Connection sourceConnection,
                                     java.sql.Connection targetConnection,
                                     java.lang.String sourceTableName,
                                     java.lang.String targetTableName,
                                     boolean clearTargetTable,
                                     boolean autoCommit)
                              throws java.sql.SQLException
Throws:
java.sql.SQLException

logIfNeeded

@AnyLogicInternalAPI
public static boolean logIfNeeded​(Utilities agent,
                                  LoggingType loggingType,
                                  java.util.function.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

logIfNeeded

@AnyLogicInternalAPI
public static boolean logIfNeeded​(Utilities agent,
                                  LoggingType loggingType,
                                  boolean staticEntry,
                                  java.util.function.Supplier<ILogEntry> logEntrySupplier)
Logs information to database
Parameters:
loggingType - type of logging
staticEntry - 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

toStringDB

public static java.lang.String toStringDB​(java.lang.Object value)
How can we improve this article?