AnyLogic
Expand
Font size

@AnyLogicInternalAPI
public class UtilitiesDatabaseBasic
extends Object
This class is internal and shouldn't be called by user.
it may be removed/renamed in future.
Author:
AnyLogic North America, LLC https://anylogic.com

Method Summary

Modifier and TypeMethodDescription
static longconvertToRelativeTime(Timestamp t, LocalDateTime beginPoint, long repeatTime) 
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 LocalDateTimegetStartOfDay(Timestamp t) 
static booleanisInt(double value)
Determines whether provided double value is integer or not.
static booleanisMariaDb(Connection connection) 
static booleanisMicrosoftAccess(Connection connection) 
static booleanisOracleDB(Connection connection) 
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

isInt

@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

getStartOfDay

@AnyLogicInternalAPI
public static LocalDateTime getStartOfDay(Timestamp t)

convertToRelativeTime

@AnyLogicInternalAPI
public static long convertToRelativeTime(Timestamp t,
 LocalDateTime beginPoint,
 long repeatTime)

isMicrosoftAccess

@AnyLogicInternalAPI
public static boolean isMicrosoftAccess(Connection connection)
                                 throws SQLException
Throws:
SQLException

isOracleDB

@AnyLogicInternalAPI
public static boolean isOracleDB(Connection connection)
                          throws SQLException
Throws:
SQLException

isMariaDb

@AnyLogicInternalAPI
public static boolean isMariaDb(Connection connection)
                         throws SQLException
Throws:
SQLException