E Wong

Greenhorn
+ Follow
since Sep 20, 2004
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by E Wong

Hi there, does anyone know of any methods that i could use to count the amount of tables that exist in a database.

What i'm basically trying to do is

if COUNT_OF_TABLES == 0{
conn.close();

Hope someone can shed some light

Best regards,
E Wong
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 ]
Hi, i'm experiencing a problem with JSP Buttons.
The scenario is as follows.

My "Submit" button is linked directly to the DB and whenever that button is clicked, an entry is recorded. Each entry is meant to be unique. However, during testing, i realized that if you double click on the button, 2 similar entries will be added into the database. The only difference would be the time of entry, which would vary by about 1 second or so.

My question is, is there a way to control this problem?

The codes are as follows

INPUT TYPE=submit VALUE='Yes' style="width:80" name=cmdYes
INPUT TYPE=button VALUE='No' style="width:80" name=cmdNo
Hopefully someone can help me in this situation

Best regards
weugene
19 years ago
JSP
thanks for the quick response!

much appreciated, will try it out now.
19 years ago
Hi there,
i need some help with a verification system that i'm trying to do at the moment.

The scenario is as follows:

A user can login by entering a string that either consists of
a: 2 alphabets and 8 digits (AB12345678) (old format)
b: 10 digits (1234567891) (new format)

My problem is verifying the first situation. I'm not sure as to how to inform the system that the login is via situation A and not situation B.

What i have done so far is as follows...
If login method = situation1,
-get char at position, getNumericValue of char, total it up and see if it is in the required range. If yes, user is verified, if no, reject.

However, before i can add that part of coding, i need to see if the first 2 values of the string is a character or an integer.

Hopefully someone can shed some light on my problem.

Best regards,
E Wong
[ September 20, 2004: Message edited by: E Wong ]
19 years ago