Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / August 2005

Tip: Looking for answers? Try searching our database.

best way to extract the data from several tables into a file

Thread view: 
mike hengins - 17 Aug 2005 21:11 GMT
hi,
I have to extract the data from several tables (Oracle is the database)
and insert them into a file, in a specified format.

Each column will be allocated a certain size (filled with empty spaces if
size is too big), and I will assign a line for each record extracted from
the tables. There wont be any delimiter.
Example of such line:
column1 colum2column2 column4 etc

So i am looking for ways to do it in Java, of course.
Thanks in advance for your suggestions and ideas.
Luke Webber - 18 Aug 2005 00:14 GMT
>  hi,
> I have to extract the data from several tables (Oracle is the database)
[quoted text clipped - 8 lines]
> So i am looking for ways to do it in Java, of course.
> Thanks in advance for your suggestions and ideas.

What part of the job is giving you problems? It seems rather
straightforward to me. Just build a SQL select statement which joins the
necessary tables, then run through it, writing out the relevant lines
one at a time. Where are you running into trouble?

Luke
mike hengins - 18 Aug 2005 00:22 GMT
No trouble really,
just trying to find the best way to do it.

SQL select statements, querying the relevant data and inserting it into the
flat file seems really boring.

I heard about tools like hibernate that do some mapping etc ... That seems
more interesting.
I am looking for experiences in this area. Anyone ?

>>  hi,
>> I have to extract the data from several tables (Oracle is the database)
[quoted text clipped - 15 lines]
>
> Luke
Luke Webber - 18 Aug 2005 00:36 GMT
> No trouble really,
> just trying to find the best way to do it.
[quoted text clipped - 4 lines]
> I heard about tools like hibernate that do some mapping etc ... That seems
> more interesting.

"Interesting" as in "May you live in interesting times". <g>

Seriously, Hibernate has a big, BIG learning curve, and it's not always
great at mapping existing databases. It's a great tool when you have a
brand new database to design, but for something like this, it's overkill.

But if you do decide to use Hibernate for a future project, be sure to
look into Hibernate Annotations. Much better than maintaining all that
metadata in XML.

> I am looking for experiences in this area. Anyone ?

Sure. Write it the way I said, using plain old JDBC. Now get coding! ;^)

Luke


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.