Reading File

Hi everyone,I has a text file. I need to read the data inside the text file word by word to store them in my database. Anyone know how to declare a file and read word by word? Please help... Thanx in advance....
[246 byte] By [caiyun01] at [2007-9-26 3:46:35]
# 1
Can anyone pls help me?How to read from text word by word in jsp?
caiyun01 at 2007-6-29 12:28:28 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2

You probly want to use the FileInputStream object and do something like this:

File file = new File(path, name);

FileInputStream input = new FileInputStream(file);

StringBuffer sb = new StringBuffer(10);

while ((bite = input.read()) != -1)

{

if (bit == ' ')

{

//do whatever you need to do with it

sb = new StringBuffer(10);

else

sb.append(bit);

}

jerkyboy at 2007-6-29 12:28:29 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...