₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,020 members, 8,419,970 topics. Date: Thursday, 04 June 2026 at 08:32 AM

Toggle theme

Codejava's Posts

Nairaland ForumCodejava's ProfileCodejava's Posts

1 (of 1 pages)

ProgrammingRe: Help On Java by codejava: 7:08am On Apr 05, 2011
Thanks segsalerty, I looked at your code is ok but i still have a challenge, 'am populating MySql db from text file. I quite can upload the data using buffer, but I made the amount column to be string, so i just want the module of the amount to be converted back to double rather than doing it manually b4 uploading. I still find it difficult to modified or apply your code.
ProgrammingRe: Help On Java by codejava: 5:57pm On Apr 04, 2011
can somebody help me to fine tone this code, i set it as string but i want to cast string to double, when storing those string:

String txt = null; String line = null;
ApplicationData app = new ApplicationData();
String[] splits = txt.split("\t"wink;
String amt = "0";
if (length > 3 && !splits[3].equals(""wink) {
amt = splits[3].trim();
amt = splits[3].replace('-',',').replace('"',',').replace('(',',').replace(')',',');
String actSplit[] = amt.split(","wink;
for(int z = 0; z < actSplit.length; z++){
      amount += actSplit[z];
    }
}
app.setAmount(amount);


my main concern is that, I want the values which i uploaded to return back in double. I think i can cast using Double.valueOf(amt); but is not working.
Kindly help pls
Certification And Training AdvertsScjd Trainer by codejava(op): 3:12pm On Nov 03, 2010
If you can train somebody on Java Developer, try to contact me tru this email dotun.daniel@yahoo.com

1 (of 1 pages)