A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
Win a copy of
Arduino in Action
this week in the
General Computing
forum!
A special promo:
Enter your blog post or vote on a blogger to be featured in an upcoming Journal
JavaRanch
»
Java Forums
»
Databases
»
JDBC
Author
to read a file and store it
Anuteja Mallampati
Greenhorn
Joined: Jan 27, 2011
Posts: 2
posted
Jan 27, 2011 01:31:41
0
public class AccountDetails { public static void main(String[] args) throws SQLException, IOException { ExtractData ed = new ExtractData(); File file = new File("/home/tsuser/new_bank_records.txt"); FileReader fr = new FileReader(file); BufferedReader br = new BufferedReader(fr); String line = br.readLine(); String[] data = {}; data = br.readLine().split(";"); while (data.length != 0) { ed.insertData(data); data = br.readLine().split(";"); } } }
I need a program to read data from a file and store data in a database..
--Thanks in advance
Paul Sturrock
Bartender
Joined: Apr 14, 2004
Posts: 10336
I like...
posted
Jan 27, 2011 02:57:03
0
Please don't change what you have posted after someone has responded. It makes the conversation very confusion and reduces the chance people can help.
can any one post it as soon as possible
Please be aware that this site is
NotACodeMill
. Show us what you have so far and we can help.
JavaRanch FAQ
HowToAskQuestionsOnJavaRanch
Jeanne Boyarsky
internet detective
Marshal
Joined: May 26, 2003
Posts: 26499
78
I like...
posted
Jan 27, 2011 18:17:09
0
Anuteja,
Welcome to CodeRanch!
Take a look at the CLOB section of the
JDBC tutorial
.
[
Blog
] [
JavaRanch FAQ
] [
How To Ask Questions The Smart Way
] [
Book Promos
]
Blogging on Certs:
SCEA Part 1
,
Part 2 & 3
,
Core Spring 3
,
OCAJP
,
OCPJP beta
,
TOGAF part 1
and
part 2
I agree. Here's the link:
http://zeroturnaround.com/jrebel
- it saves me about five hours per week
subject: to read a file and store it
Similar Threads
Reading a text file using FileReader & BufferedReader : Unexpected output !
To find a largest sector in a given input string of 1's and 0's
readLine() and read() functionality
problem in IO reader
Incompatible type issue
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter