|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectscriptella.spi.AbstractConnection
public abstract class AbstractConnection
A base class for connections.
Subclassing is more safe than directly implementing Connection interface.
| Nested Class Summary | |
|---|---|
static class |
AbstractConnection.StatementCounter
Helper class to use for executed statements counting. |
| Field Summary | |
|---|---|
protected AbstractConnection.StatementCounter |
counter
|
| Constructor Summary | |
|---|---|
protected |
AbstractConnection()
May be used by sublasses to allow full customization |
protected |
AbstractConnection(ConnectionParameters parameters)
Instantiates a connection with parameters. |
protected |
AbstractConnection(DialectIdentifier dialectIdentifier,
ConnectionParameters parameters)
Instantiates a connection with dialectIdentifier and connection parameters. |
| Method Summary | |
|---|---|
void |
commit()
Commits a current transaction (if any). |
DialectIdentifier |
getDialectIdentifier()
This method returns a language dialect identifier for this connection. |
long |
getExecutedStatementsCount()
This method returns the number of executed statements or 0 if this feature is unsupported. |
boolean |
isReadonly()
Returns readonly mode. |
void |
rollback()
Rolls back a current transaction (if any). |
protected void |
setDialectIdentifier(DialectIdentifier dialectIdentifier)
|
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface scriptella.spi.Connection |
|---|
close, executeQuery, executeScript |
| Field Detail |
|---|
protected final AbstractConnection.StatementCounter counter
| Constructor Detail |
|---|
protected AbstractConnection()
protected AbstractConnection(DialectIdentifier dialectIdentifier,
ConnectionParameters parameters)
dialectIdentifier - dialect identifier.parameters - connection parameters to use for general properties.protected AbstractConnection(ConnectionParameters parameters)
parameters - connection parameters to use for general properties.| Method Detail |
|---|
public DialectIdentifier getDialectIdentifier()
Connection
getDialectIdentifier in interface Connectionprotected void setDialectIdentifier(DialectIdentifier dialectIdentifier)
public long getExecutedStatementsCount()
ConnectionIf possible the connection should collect statistics about the number of executed statement. It's recommended to provide the most actual execution statistics, i.e. increment internal statements counter during a script or a query execution, so the monitoring tools would be able to track progress.
getExecutedStatementsCount in interface Connectionpublic boolean isReadonly()
readonly=true means updates must be skipped by the driver. This property is configurable by readonly property of connection declaration element. Drivers are not required to support this feauture.
public void commit()
throws ProviderException
ConnectionThrowing an error during commit phase cause rollback.
commit in interface ConnectionProviderException - if a problem occured during commit phase.
public void rollback()
throws ProviderException,
java.lang.UnsupportedOperationException
Connection
rollback in interface ConnectionProviderException - if driver fails to roll back a transaction.
java.lang.UnsupportedOperationException - if transactions are not supportedpublic java.lang.String toString()
toString in interface ConnectiontoString in class java.lang.Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||