public class Autonumerical extends Object
| Modifier and Type | Class and Description |
|---|---|
protected class |
Autonumerical.SavingThread |
| Constructor and Description |
|---|
Autonumerical(String propertyFile,
DatabaseConnectionManager dbConMan) |
Autonumerical(URL propertyFile,
Connection connection)
Creates a new Autonumerical object instance
|
Autonumerical(URL propertyFile,
DatabaseConnectionManager dbConMan) |
Autonumerical(URL propertyFile,
URL urlDBProp)
Creates a new Autonumerical object instance
|
Autonumerical(URL propertyFile,
URL urlDBProp,
boolean createFistConnection) |
| Modifier and Type | Method and Description |
|---|---|
void |
activateForceDisconnection() |
OntimizeConnection |
connect() |
void |
disactivateForceDisconnection() |
protected void |
finalize() |
int |
getAutonumerical()
Gets an sequential integer value to use as unique identifier.
|
int |
getAutonumerical(String col) |
protected int |
getColumnNameIndex(String name) |
protected String |
getCurrentThreadMethods(Throwable e,
int lines) |
protected int |
increment(String column) |
protected int |
increment(String column,
Connection con) |
int |
incrementAutonumerical(int increment) |
int |
incrementAutonumerical(int increment,
String col) |
protected int |
incrementSequence(String column,
Connection con)
HSQLDB - NEXT VALUE FOR sequence_name ORACLE - sequence_name.nextval
POSTGRES - nextval('sequence_name') SQLServer - NEXT VALUE FOR
sequence_name
|
protected void |
initAutonumerical() |
protected void |
initConnection(URL urlDBProp,
boolean createFirstConnection) |
protected void |
initializeTable(Connection con) |
boolean |
isForceDisconnectionEnabled() |
boolean |
isSynchronized() |
protected void |
logToLogKeys(String s) |
protected void |
logToLogKeys(String s,
boolean newLine) |
protected Connection |
reconnection() |
protected void |
save() |
protected boolean |
saveAutonumerical() |
protected boolean |
setIncorrectState() |
protected void |
startSavingThread() |
public static boolean SYNCHRONIZE
public static boolean isolationLevelChange
public static final String TABLE
public static final String COLUMN
public static final String STATE_COLUMN
public static final String LOG_KEYS
public static final String SAVING_CYCLE
public static final String SAVING_INTERVAL
public static final String SYNCHRONIZE_VALUE
public static final String ISOLATION_LEVEL
public static final String SEQUENCES
public static final String SEQUENCE_FORMAT
protected static final int DEFAULT_SAVING_CICLE
protected int savingInterval
protected String table
protected String column
protected String stateColumn
protected Vector logkeys
protected int savingCycle
protected Connection staticCon
protected String[] columnNames
protected int[] autonumerical
protected Properties properties
protected Properties databaseProperties
protected Autonumerical.SavingThread thread
protected String user
protected String password
protected String driver
protected String uRLDatabase
protected int autonumericalCountSinceLastSave
protected volatile boolean bSynchronized
protected boolean isolationChange
protected boolean useSequence
protected String defaultSequence
protected String sequenceFormat
protected Hashtable tableToSequence
protected DatabaseConnectionManager manager
protected boolean forceDisconnection
public Autonumerical(URL propertyFile, Connection connection) throws Exception
propertyFile - In the property file 'propertyFile' the following parameters
are included::connection - Database connectionExceptionpublic Autonumerical(URL propertyFile, URL urlDBProp) throws Exception
propertyFile - In the property file 'propertyFile' the following parameters
are included::urlDBProp - This parameter specifies the DB connection property file. It
will have the following parameters::Exceptionpublic Autonumerical(URL propertyFile, URL urlDBProp, boolean createFistConnection) throws Exception
Exceptionpublic Autonumerical(URL propertyFile, DatabaseConnectionManager dbConMan) throws Exception
Exceptionpublic Autonumerical(String propertyFile, DatabaseConnectionManager dbConMan) throws Exception
Exceptionprotected void initAutonumerical()
protected int getColumnNameIndex(String name)
protected void startSavingThread()
protected void initConnection(URL urlDBProp, boolean createFirstConnection) throws Exception
Exceptionpublic int getAutonumerical()
public int getAutonumerical(String col)
public int incrementAutonumerical(int increment)
public int incrementAutonumerical(int increment,
String col)
protected boolean saveAutonumerical()
protected int incrementSequence(String column, Connection con) throws Exception
column - con - Exceptionprotected int increment(String column, Connection con) throws Exception
Exceptionprotected void initializeTable(Connection con) throws Exception
Exceptionprotected boolean setIncorrectState()
protected Connection reconnection() throws Exception
Exceptionprotected void finalize()
throws Throwable
protected void logToLogKeys(String s)
protected void logToLogKeys(String s, boolean newLine)
public void activateForceDisconnection()
throws Exception
Exceptionpublic void disactivateForceDisconnection()
throws Exception
Exceptionpublic boolean isForceDisconnectionEnabled()
public boolean isSynchronized()
public OntimizeConnection connect() throws Exception
ExceptionCopyright © 2016 Imatia Innovation S.L.. All rights reserved.