Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamically retrieving data from an Oracle database

Status
Not open for further replies.

JProg

Programmer
Apr 4, 2002
88
JP
Hey everyone,

I am still learning jdbc but I have written a cool little application that successfully connects to an Oracle database and am now in the process of "piping" the contents of a text file to the database. I have written my program to be command line orientated with a binary flag that determines whether to perform an executeUpdate or executeQuery command. I have written all of the code for Updating and am very happy with it however I have now come to writing the Query code and am a little stuck for ideas.

It has occured to me that in order to dynamically retrieve the values in a database then a ResultSetMetaData object must first be used to determine the column types (so that correct types can be maintained). I am a little lost with regard to how I should use this object to dynamically retrieve the actual values from the database.

If anybody can help me with dynamic retrieval of database data I will be greatly appreciative.

Thanks

Regards

David
 
David:
Our programmers use the metadata to do a few things..
1. verify the datatypes
2. Find the table column information

They construct a select(s) statement(s) batch them then run the batch for the data.
They handle if not all the values are used ( NULL values) and return errors for data that does not match the data types.

Some of the programmers create there own code but others have use what java has out there for SQL and databases.
Hope this helps
T
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top