public class OntimizeConnection extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Connection |
connection |
static boolean |
DEBUG |
protected long |
lastUsedHour |
protected boolean |
lock |
protected int |
reservationId |
protected boolean |
reserved |
protected long |
reserveRequestTime |
| Constructor and Description |
|---|
OntimizeConnection(Connection con)
Creates a new OntimizeConnection instance with the specified database
connection
|
OntimizeConnection(String driver,
String dbURL,
String user,
String password)
Creates a new OntimizeConnection instance using the specified database
parameters
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancelReservation() |
void |
close()
Close the database connection
|
Connection |
getConnection()
Get the database connection
|
String |
getConnectionLockStack() |
String |
getCurrentLockKey() |
long |
getLastUseTime()
Gets the last time when this connection has been used
|
long |
getReservationElapsedTime() |
int |
getReservationId() |
boolean |
isLocked()
Is true if this connection is locked
|
boolean |
isReserved() |
boolean |
reserve(int reserveId)
Reserver this OntimizeConnection
|
void |
setLastUseTime(long time)
Sets the time value for the last connection use parameter
|
void |
setLock(boolean lock)
Sets the lock parameter value
|
public static boolean DEBUG
protected volatile Connection connection
protected boolean lock
protected long lastUsedHour
protected boolean reserved
protected int reservationId
protected long reserveRequestTime
public OntimizeConnection(String driver, String dbURL, String user, String password) throws Exception
driver - Database driverdbURL - Database urluser - Database userpassword - Database passwordExceptionpublic OntimizeConnection(Connection con) throws Exception
con - Exceptionpublic long getLastUseTime()
public boolean isLocked()
public void setLastUseTime(long time)
time - time to setpublic String getConnectionLockStack()
public void setLock(boolean lock)
lock - public String getCurrentLockKey()
public boolean reserve(int reserveId)
reserveId - public long getReservationElapsedTime()
public boolean isReserved()
public void cancelReservation()
public int getReservationId()
public Connection getConnection()
public void close()
Copyright © 2016 Imatia Innovation S.L.. All rights reserved.