• Post Reply Bookmark Topic Watch Topic
  • New Topic

problems fetching DB values inserted into Hashtable not working in linux.  RSS feed

 
Mukesh ks
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i wrote a program to get values from hashtable with key which contains the resultset values with ColumnName as key and its values from mysql db. it is working good in windows and ubuntu(which tested in our local machine) . but not working in remote server in linux fedora.

my code was like below

getvalues(HashTable h,String Label)
{

String Values = (String) (h.get("USER_"+ Label) != null ? h.get("USER_"+Label) : "");

return Values;
}
is there any problem with this.

can you please tell me

I'm dead in the water please help me
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If this was my problem the first thing I would do is dump all the keys in the hashtable to a log file. You may be really surprised by what is in there.

The keySet method is the appropriate way to get those key values.

Bill
 
Mukesh ks
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bill for reply

i fixed issue .it is related to the mysql_connector jar(mysql-connector-java-5.1.23-bin.jar) files which i am using ,
it is not supporting getColumnNames() when i put it into hashtable.

so i rewrite my code like

hashtable.put(rs.getColumnLabel(i).toUpperCase(), value);



-Mukesh
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!