openlsd.database.session.LSDDbSession Class Reference

Collaboration diagram for openlsd.database.session.LSDDbSession:

Collaboration graph
[legend]

List of all members.


Detailed Description

Class to handle session with the SGBD of LSD
Author:
Frederic Bregier LGPL

Public Member Functions

 LSDDbSession (Connection connext, boolean isReadOnly)
 LSDDbSession (String server, String user, String passwd, boolean isReadOnly)
boolean disconnect ()
boolean commit ()
boolean rollback (Savepoint savepoint)
Savepoint savepoint ()
boolean releaseSavepoint (Savepoint savepoint)

Static Public Member Functions

static void error (SQLException ex)

Public Attributes

Connection conn = null
boolean isReadOnly = true

Constructor & Destructor Documentation

openlsd.database.session.LSDDbSession.LSDDbSession ( Connection  connext,
boolean  isReadOnly 
)

Create a session and connect the current object to the connext object given as parameter.

The database access use no auto commit.

If the initialize is not call before, call it with the default value.

Parameters:
connext 
isReadOnly 

openlsd.database.session.LSDDbSession.LSDDbSession ( String  server,
String  user,
String  passwd,
boolean  isReadOnly 
)

Create a session and connect the current object to the server using the string with the form for mysql jdbc:type://[host:port],[failoverhost:port].../[database][?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...

By default (if server = null) : "jdbc:mysql://localhost/lsd user=lsd password=lsd"

The database access use no auto commit.

If the initialize is not call before, call it with the default value.

Parameters:
server 
user 
passwd 
isReadOnly 


Member Function Documentation

static void openlsd.database.session.LSDDbSession.error ( SQLException  ex  )  [static]

Print the error from SQLException

Parameters:
ex 

boolean openlsd.database.session.LSDDbSession.disconnect (  ) 

Close the connexion

Returns:
True if correctly disconnected, else False

boolean openlsd.database.session.LSDDbSession.commit (  ) 

Commit everything

Returns:
True if OK, else False

boolean openlsd.database.session.LSDDbSession.rollback ( Savepoint  savepoint  ) 

Rollback from the savepoint or the last set if null

Parameters:
savepoint 
Returns:
True if OK, else False

Savepoint openlsd.database.session.LSDDbSession.savepoint (  ) 

Make a savepoint

Returns:
the new savepoint or null if an error occurs

boolean openlsd.database.session.LSDDbSession.releaseSavepoint ( Savepoint  savepoint  ) 

Release the savepoint

Parameters:
savepoint 
Returns:
True if OK, else False


Member Data Documentation

The internal connection

Is this connection Read Only


The documentation for this class was generated from the following file: