RSS Forums RSS

Text File to Java to Oracle

Please support our Java advertiser: Programming Forums
Thread Solved
Reply
Posts: 16
Reputation: ebiz is an unknown quantity at this point 
Solved Threads: 0
ebiz ebiz is offline Offline
Newbie Poster

Text File to Java to Oracle

  #1  
Nov 20th, 2008
I currently have a table in oracle which I have created, but need to take a text file (which I have used a fileChooser for) and then use this file to update the records in the oracle database. How would I go about this?

Thanks.
AddThis Social Bookmark Button
Reply With Quote  
Posts: 1,158
Reputation: javaAddict is just really nice javaAddict is just really nice javaAddict is just really nice javaAddict is just really nice 
Solved Threads: 163
javaAddict's Avatar
javaAddict javaAddict is offline Offline
Veteran Poster

Re: Text File to Java to Oracle

  #2  
Nov 20th, 2008
Read the file for its data.
Then use that data to query the database: Run an UPDATE to record you want to update.

Learn how to read files.
Learn SQL.
Learn how to run queries with java.
There are 3 ways to do things:
The right way, the wrong way,
And The Object Oriented Way.

When you do things your way, make sure you don't forget the Object Oriented Way
Reply With Quote  
Posts: 27
Reputation: AlbertPi is an unknown quantity at this point 
Solved Threads: 2
AlbertPi AlbertPi is offline Offline
Light Poster

Re: Text File to Java to Oracle

  #3  
Nov 20th, 2008
Originally Posted by ebiz View Post
I currently have a table in oracle which I have created, but need to take a text file (which I have used a fileChooser for) and then use this file to update the records in the oracle database. How would I go about this?

Thanks.


You need a update statement to update your table in oracle. See below for "Update" syntax:
UPDATE table
SET column = expression
WHERE predicates;

Also you google to find "update", you will find a lot of examples. :-) .
Reply With Quote  
Posts: 16
Reputation: ebiz is an unknown quantity at this point 
Solved Threads: 0
ebiz ebiz is offline Offline
Newbie Poster

Re: Text File to Java to Oracle

  #4  
Nov 20th, 2008
thanks. i heard something about arrays, so i need to set the data from the text file as arrays, if so, how?
Reply With Quote  
Posts: 4,111
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 458
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is online now Online
Industrious Poster

Re: Text File to Java to Oracle

  #5  
Nov 20th, 2008
Whether you use arrays, Lists, or whatever, the point is still the same. You'll need to read the file content into some structure and then use JDBC to update/insert your table values.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.



Similar Threads
Other Threads in the Java Forum
Views: 660 | Replies: 4 | Currently Viewing: 1 (0 members and 1 guests)

 

Thread Tools Display Modes
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 3:21 pm.
Newsletter Archive - Sitemap - Privacy Statement - Acceptable Use Policy - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC