AnyLogic
Expand
Font size

public class UtilitiesDatabase
extends Object

Method Summary

Modifier and TypeMethodDescription
static voidcopyDatabaseTable(Connection sourceConnection, Connection targetConnection, String sourceTableName, String targetTableName) 
static voidcopyDatabaseTable(Connection sourceConnection, Connection targetConnection, String sourceTableName, String targetTableName, boolean clearTargetTable, boolean autoCommit) 
static voidcopyDatabaseTables(ProgressConsumer monitor, Connection sourceConnection, Connection targetConnection, List<String> sourceTableNames, List<String> targetTableNames, boolean clearTargetTable, boolean autoCommit) 
static voidexportTables(ProgressConsumer monitor, Connection sourceDatabase, Connection targetDatabase, Collection<String> sqlStatements, List<String> sourceNames) 
static StringgetIdentifierQuoteString(Connection connection) 
static booleanlogIfNeeded(Utilities agent, LoggingType loggingType, boolean staticEntry, Supplier<ILogEntry> logEntrySupplier)
Logs information to database
static booleanlogIfNeeded(Utilities agent, LoggingType loggingType, Supplier<ILogEntry> logEntrySupplier)
Logs information to database
static StringtoStringDB(Object value) 
static StringtrimTableName(String s) 

Methods inherited from class java.lang.Object

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

Method Details

getIdentifierQuoteString

@AnyLogicInternalAPI
public static String getIdentifierQuoteString(Connection connection)

exportTables

@AnyLogicInternalAPI
public static void exportTables(ProgressConsumer monitor,
 Connection sourceDatabase,
 Connection targetDatabase,
 Collection<String> sqlStatements,
 List<String> sourceNames)

trimTableName

@AnyLogicInternalAPI
public static String trimTableName(String s)

copyDatabaseTables

@AnyLogicInternalAPI
public static void copyDatabaseTables(ProgressConsumer monitor,
 Connection sourceConnection,
 Connection targetConnection,
 List<String> sourceTableNames,
 List<String> targetTableNames,
 boolean clearTargetTable,
 boolean autoCommit)

copyDatabaseTable

@AnyLogicInternalAPI
public static void copyDatabaseTable(Connection sourceConnection,
 Connection targetConnection,
 String sourceTableName,
 String targetTableName)

copyDatabaseTable

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

logIfNeeded

@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

logIfNeeded

@AnyLogicInternalAPI
public static boolean logIfNeeded(Utilities agent,
 LoggingType loggingType,
 boolean staticEntry,
 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 String toStringDB(Object value)