public class Connector extends Object
| Constructor and Description |
|---|
Connector()
The default Connector will use the ConnectionManager to connect to the
database.
|
Connector(String connectionUrl)
The Connector wraps the specified connection string.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Commits the current transaction and closes a the current connection if
the connection counter has reached 0.
|
static void |
closeConnection()
Close the current connection.
|
static void |
disable()
Disable the static usage of the Connector.
|
static void |
enable()
Enables the static usage of the connector.
|
Connection |
getConnection() |
String |
getConnectionUrl() |
static Connector |
getInstance()
The singleton connector based on the ConnectionManager using the default
connection string.
|
boolean |
isEnabled()
Gets if the current connector is enabled.
|
Connection |
open()
Open a connection and returns it or increment an internal counter and
return the already existing connection.
|
static Connection |
openConnection()
Open a connection to the default database.
|
void |
rollback() |
static void |
rollBack()
Rollback all transactions based on the current connection.
|
void |
setEnabled(boolean enabled)
Sets the enabled property to true or false.
|
public Connector()
public Connector(String connectionUrl)
connectionUrl - the connection URL to use.public static Connector getInstance()
public static Connection openConnection() throws SQLException
SQLExceptionpublic static void rollBack()
public static void closeConnection()
public static void enable()
public static void disable()
public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled - the state desired.public String getConnectionUrl()
public Connection open() throws SQLException
SQLExceptionpublic void close()
public void rollback()
public Connection getConnection()
Copyright © 2013. All rights reserved.