|
LEONARDI Application Composer - 8.9.0.40 by W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectleon.peer.LyConnection
leon.peer.sql.LySqlConnection
public class LySqlConnection
This class is used as a connection for relational database.
LyConnection
Field Summary | |
---|---|
static java.lang.String |
__VERSION
|
static int |
STATEMENT_TIMEOUT
Default statement timeout |
Constructor Summary | |
---|---|
LySqlConnection(LyApplication application,
java.lang.String name)
Constructor. |
|
LySqlConnection(LyApplication application,
java.lang.String name,
javax.sql.DataSource dataSource)
Constructor. |
Method Summary | |
---|---|
void |
autoCommit(boolean status)
To change the autoCommit mode of the JDBC connection. |
boolean |
close()
Close the physical connection to the database. |
void |
commit()
To commit a pending transaction for this connection. |
java.sql.Connection |
getConnection()
Gets connection to the database. |
java.sql.DatabaseMetaData |
getMetaData()
To get meta-information from the database. |
java.util.Properties |
getProperties()
To get the properties of this SQL connection. |
java.sql.Statement |
getStatement()
Gets current statement to the database. |
void |
handleError(java.sql.SQLException e)
Method to handle SQLException. |
boolean |
open(java.lang.String username,
java.lang.String password)
Open the physical connection to the database. |
boolean |
open(java.lang.String username,
java.lang.String password,
java.lang.String driverName)
Open the physical connection to the database. |
void |
released()
Connection released. |
void |
rollback()
To rollback a pending transaction for this connection. |
java.sql.ResultSet |
sendQueryRequest(java.lang.String request)
Sends a request to the database. |
java.sql.ResultSet |
sendQueryRequest(java.lang.String request,
int limit)
Sends a request to the database. |
int |
sendUpdateRequest(java.lang.String request)
Sends a request to the database. |
void |
setStatementTimeout(int statementTimeout)
Sets the _statementTimeout attribute for current connection. |
Methods inherited from class leon.peer.LyConnection |
---|
addValue, dump, getError, getUID, getValue, isClosed, isReserved, prepareCommit, reserved, setDataProvider, setError, setUID |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String __VERSION
public static int STATEMENT_TIMEOUT
Constructor Detail |
---|
public LySqlConnection(LyApplication application, java.lang.String name)
application
- Application of the data provider that manages this connection.name
- Name of the database.public LySqlConnection(LyApplication application, java.lang.String name, javax.sql.DataSource dataSource)
application
- Application of the data provider that manages this connection.name
- Name of the database.dataSource
- JDBC DataSource providing the JDBC connection.Method Detail |
---|
public void setStatementTimeout(int statementTimeout)
_statementTimeout
attribute for current connection.
statementTimeout
- new value for the _statementTimeout
attributepublic boolean open(java.lang.String username, java.lang.String password)
username
- user id.password
- user password.
public boolean open(java.lang.String username, java.lang.String password, java.lang.String driverName)
username
- user id.password
- user password.driverName
- The driver class name.
public boolean close()
close
in class LyConnection
public void released()
released
in class LyConnection
public java.util.Properties getProperties()
public java.sql.DatabaseMetaData getMetaData()
public java.sql.ResultSet sendQueryRequest(java.lang.String request)
request
- the sql request.
public java.sql.ResultSet sendQueryRequest(java.lang.String request, int limit)
request
- the sql request.limit
- maximum number of rows to fetch (-1 for no limit)
public int sendUpdateRequest(java.lang.String request)
request
- the sql request.
public void handleError(java.sql.SQLException e)
e
- SQLEXception to handle.public void commit()
LyConnection
commit
in class LyConnection
public void rollback()
LyConnection
rollback
in class LyConnection
public void autoCommit(boolean status)
autoCommit
in class LyConnection
status
- the new mode.public java.sql.Connection getConnection()
public java.sql.Statement getStatement()
|
(c) January 2013 - W4 S.A. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |