DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Java (http://www.daniweb.com/forums/forum9.html)
-   -   Text File to Java to Oracle (http://www.daniweb.com/forums/thread158515.html)

ebiz Nov 20th, 2008 6:44 am
Text File to Java to Oracle
 
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.

javaAddict Nov 20th, 2008 7:32 am
Re: Text File to Java to Oracle
 
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.

AlbertPi Nov 20th, 2008 11:03 am
Re: Text File to Java to Oracle
 
Quote:

Originally Posted by ebiz (Post 740412)
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. :-) :).

ebiz Nov 20th, 2008 7:41 pm
Re: Text File to Java to Oracle
 
thanks. i heard something about arrays, so i need to set the data from the text file as arrays, if so, how?

Ezzaral Nov 20th, 2008 7:52 pm
Re: Text File to Java to Oracle
 
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.


All times are GMT -4. The time now is 7:59 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC