openlsd.database.session.LSDDbAdmin Class Reference

Collaboration diagram for openlsd.database.session.LSDDbAdmin:

Collaboration graph
[legend]

List of all members.


Detailed Description

Class for Admin through Database
Author:
Frederic Bregier LGPL

Public Member Functions

 LSDDbAdmin (String driver, String server, String user, String passwd)
 LSDDbAdmin (String driver, String server, String user, String passwd, boolean write)
 LSDDbAdmin (Connection conn, boolean isread)
void close ()
void commit ()

Static Public Member Functions

static void initialize (String driver)

Public Attributes

boolean isConnected = false
boolean isReadOnly = false
boolean isMultipleDBAccess = false
LSDDbSession session = null

Static Public Attributes

static boolean classLoaded = false

Private Attributes

String driver = null
String server = null
String user = null
String passwd = null

Constructor & Destructor Documentation

openlsd.database.session.LSDDbAdmin.LSDDbAdmin ( String  driver,
String  server,
String  user,
String  passwd 
)

This version creates a default write enabled connection.

A this time, only one driver is possible! If a new driver is needed, then we need to create a new LSDDbSession object. Be aware that LSDDbSession.initialize should be call only once for each driver, whatever the number of LSDDbSession objects that could be created (=> need a hashtable for specific driver when created). Also, don't know if two drivers at the same time (two different LSDDbSession) is allowed by JDBC.

Parameters:
driver 
server 
user 
passwd 

openlsd.database.session.LSDDbAdmin.LSDDbAdmin ( String  driver,
String  server,
String  user,
String  passwd,
boolean  write 
)

This version creates can create a read only connection if write is false.

A this time, only one driver is possible! If a new driver is needed, then we need to create a new LSDDbSession object. Be aware that LSDDbSession.initialize should be call only once for each driver, whatever the number of LSDDbSession objects that could be created (=> need a hashtable for specific driver when created). Also, don't know if two drivers at the same time (two different LSDDbSession) is allowed by JDBC.

Parameters:
driver 
server 
user 
passwd 
write 

openlsd.database.session.LSDDbAdmin.LSDDbAdmin ( Connection  conn,
boolean  isread 
)

Use a given connexion to create the context.

A this time, only one driver is possible! If a new driver is needed, then we need to create a new LSDDbSession object. Be aware that LSDDbSession.initialize should be call only once for each driver, whatever the number of LSDDbSession objects that could be created (=> need a hashtable for specific driver when created). Also, don't know if two drivers at the same time (two different LSDDbSession) is allowed by JDBC.

This version use given connection. typeDriver must be set before !

Parameters:
conn 
isread 


Member Function Documentation

static void openlsd.database.session.LSDDbAdmin.initialize ( String  driver  )  [static]

Load the correct jdbc driver (default com.mysql.jdbc.Driver)

Parameters:
driver 

void openlsd.database.session.LSDDbAdmin.close (  ) 

Close the underlying session. Can be call even for connection given from the constructor LSDDbAdmin(Connection, boolean).

void openlsd.database.session.LSDDbAdmin.commit (  ) 

Commit on connection


Member Data Documentation

DB Driver

DB Server

DB User

DB Password

Is this DB Admin connected

Is this DB Admin Read Only

Is this DB Admin accessed by only one thread at a time (no concurrency and no lock/unlock problem)

session is the Session object for all type of requests

Info on JDBC Class is already loaded or not


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