Hi all, i'm experiencing another problem on JSP which has really stumped me.
The problem i am encountering is as follows.
My current web application (Page A) allows me to pull a list of tables from a specific database (24/7 connectivity) and lists it out on a new page (Page B). However, if that specific DB is taken offline (restart,crash etc) somethings goes wrong with my db connection. I am still able to click submit an advance to "Page B" but there are no tables listed. If i am not mistaken, the connection is still "live" but there is something wrong with the metadata. Can anyone give me some insight on this problem?
A fragment of the codes are as follows:
if(addData){
ResultSet tableNames;
//dbmd = conn.getMetaData(); take out by poo take cater connection pool broken
String tblName="";
try {
if(sDTSourceType.equals("MSACCESS")){
String[] names = {"TABLE"};
dbmd = conn.getMetaData();//add by poo
tableNames = dbmd.getTables(null,null,null, names);
} else if(sDTSourceType.equals("MYSQL")){
String[] names = {"TABLE"};
dbmd = conn.getMetaData();
tableNames = dbmd.getTables(null,null,null, names);
} else {
String[] names = {"TABLE","SYNONYM"};
/*
String uid = (String)request.getSession().getAttribute("UserID");
if (uid == null) {
uid = "%";
}
*/
tableNames = aDbManager.getTables(null, "%", "%", names);
}
while (tableNames.next()){
tblName = tableNames.getString("TABLE_NAME");
vRow.add(tblName.trim());
}//end while
tableNames.close();
---------------
In my situation, i'm using MSSQLType4 as the DB.
Hopefully someone can help.
Best regards,
E Wong
[ October 14, 2004: Message edited by: E Wong ]
[ October 14, 2004: Message edited by: E Wong ]
[ October 14, 2004: Message edited by: E Wong ]