By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,649 Members | 2,142 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,649 IT Pros & Developers. It's quick & easy.

read files and upload in database

P: 6
Hi

Can anyone provide an example of how to read files in java and upload this information to the database ?

Thanks
Feb 21 '07 #1
Share this Question
Share on Google+
14 Replies


sicarie
Expert Mod 2.5K+
P: 4,677
Hi

Can anyone provide an example of how to read files in java and upload this information to the database ?

Thanks
Here is a link on Java File IO.

As for the database question, you're going to have to download your driver, either put it in your classpath or attach it to your program, create a connection, and upload. How you do this is dependent on what type of database you are connecting to.
Feb 21 '07 #2

10K+
P: 13,264
Hi

Can anyone provide an example of how to read files in java and upload this information to the database ?

Thanks
What type of files? .txt, .pdf, .doc, .xml?
Feb 21 '07 #3

P: 6
thaks for your help, but I need to read files in java and upload this information to the database with a Web Applications
Mar 1 '07 #4

10K+
P: 13,264
thaks for your help, but I need to read files in java and upload this information to the database with a Web Applications
Are you going to tell us what tpye of files they are?
Mar 1 '07 #5

P: 6
Are you going to tell us what tpye of files they are?
thaks for your help, I need to read files.txt in java and upload this information to the database using Java Beans
Mar 6 '07 #6

10K+
P: 13,264
thaks for your help, I need to read files.txt in java and upload this information to the database using Java Beans
Are you able to connect to the database then. If they are .txt files then reading is not going to be a problem. You can use Scanner or FileReader. What you need to do is make sure you've got your database connection right. What is the structure of the data in the text files and how do you want it to be structured in the database.
Mar 7 '07 #7

P: 6
Please, can you give a code example?
Thanks
Mar 9 '07 #8

sicarie
Expert Mod 2.5K+
P: 4,677
Please, can you give a code example?
Thanks
Not really, there aren't enough details. What database are you using? How do you want to connect - with what driver?

So you understand the FileReader/Scanner portion?
Mar 9 '07 #9

10K+
P: 13,264
Please, can you give a code example?
Thanks
For which part? Have you written anything yourself yet? Write the file reading part first.
Mar 10 '07 #10

P: 6
Not really, there aren't enough details. What database are you using? How do you want to connect - with what driver?

So you understand the FileReader/Scanner portion?
I am using Oracle 9i, i want to do a java bean that read the file and save the information in the database.
Thanks
Mar 12 '07 #11

10K+
P: 13,264
I am using Oracle 9i, i want to do a java bean that read the file and save the information in the database.
Thanks
Well start on it. When you get stuck with the code post and then we'll be able to help.
Mar 12 '07 #12

P: 6
Well start on it. When you get stuck with the code post and then we'll be able to help.
I have the code to connect to a database, i need only the instructions for read the text file then i have to upload that contents into a table.
Mar 30 '07 #13

sicarie
Expert Mod 2.5K+
P: 4,677
I have the code to connect to a database, i need only the instructions for read the text file then i have to upload that contents into a table.
http://www.google.com/search?hl=en&q...=Google+Search http://www.google.com/search?hl=en&q...=Google+Search

The first links (the javadocs) will probably be the most helpful to you.
Mar 30 '07 #14

10K+
P: 13,264
I have the code to connect to a database, i need only the instructions for read the text file then i have to upload that contents into a table.
The tip of the week talks about how to read files.
Mar 31 '07 #15

Post your reply

Sign in to post your reply or Sign up for a free account.