• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to store a Excel,CSV,.TXT file into Oracle Database using Java.

 
Greenhorn
Posts: 26
Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
I have a excel and .csv file. I have moved this files to server area from local desktop. but now I have to read this file and have to insert the data into a Oracle Database Table. can anyone help me to acheive this.
Thanks in advance.
 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly do you need help with? opening the file? parsing it? connecting to the DB? writing the SQL?

As written, your question is a little to vague to get any real help.
 
Ranch Hand
Posts: 116
2
Eclipse IDE PHP Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My suggestion is to focus on one part of the problem at a time.

If I were you I would write some basic requirements for the app and then write some pseudo code first to get a better understanding of exaclty what steps need to be taken.

From there, tackle one step at a time and if you run into issues, post very specific questions about the problem you are running into. Then just keep building on each step.

 
Barnabas Jeremiah
Greenhorn
Posts: 26
Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is my requirement:
1)Need to browse a file (csv,txt) and have upload it to the Application Server Area path.
2)Need to read the file from that path and need to insert all column data of the file into a Oracle Table's columns.
 
Scott Winterbourne
Ranch Hand
Posts: 116
2
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Doing a quick Google search for "java read contents of text file" produced a couple resutls with examples of how to read the contest of a text file using Java.
http://stackoverflow.com/questions/326390/how-to-create-a-java-string-from-the-contents-of-a-file
http://stackoverflow.com/questions/16027229/reading-from-a-text-file-and-storing-in-a-string

Start with getting your code to successfully read the contents of the txt or csv file. They print some of the results to the consol to verify it is working properly.

Once you have your code reading the file properly, take a look at JDBC for connecting to the Oracle database. Once you get this working independently, you can put both parts of the application together.
 
Barnabas Jeremiah
Greenhorn
Posts: 26
Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much. Now I am using openCSV jar to read csv files and text files. is it good to use opencsv.jar ? or is there any other good way to read the csv files ?
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Define "good". There is no shortage of alternatives: https://coderanch.com/how-to/java/AccessingFileFormats
 
reply
    Bookmark Topic Watch Topic
  • New Topic