|
Hi Ravi, i think you can mantain this using a SystemManager and
DatabaseManager class that uses a Singleton design pattern, for example.
public class SystemManager {
private static SystemManager instance;
private DatabaseManager db;
private SystemManager() { // constructor
db = new
DatabaseManager();
}
public static SystemManager getInstance() {
if ( instance == null ) instance
= new SystemManager();
return instance;
}
public DatabaseManager getDBManager() {
return db;
}
}
public class DatabaseManager {
private con1 = ...;
public DatabaseManager() {
con1 = new
Connection(...);
}
public java.sql.Connection getConnection() {
return con1;
}
}
any time in your development, you can call getInstance() method of the
SystemManager class. It will return the unique instance of this class wich has
the desired DatabaseConnection instance.
hope i could help you.
Regards,
Marcelo d'Amorim.
----- Original Message -----
|
Title: ExpenseManager Application
- ExpenseManager Application Gopalankutty, Ravi Kumar (CTS)
- Re: ExpenseManager Application Marcelo Bezerra d'Amorim
- Re: ExpenseManager Application Jason Hunter
