• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Another JSP Problem - Database related

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hai dear..
close your all ResultSet u open and also Database connection.
eg: rs.close();//close resultset
conn.close();//close the connection
thanks..
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Moving to the JDBC forum.
 
E Wong
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
managed to solve it
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic