aspose file tools*
The moose likes JDBC and the fly likes Retreiving data from Table_A and at the same time inserting into Table_A Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Retreiving data from Table_A and at the same time inserting into Table_A " Watch "Retreiving data from Table_A and at the same time inserting into Table_A " New topic
Author

Retreiving data from Table_A and at the same time inserting into Table_A

Muyiwa Johnnny
Greenhorn

Joined: Nov 22, 2003
Posts: 2
I want to retreive data from a database and insert into the same database but a different table on the database.
The idea is I want to treive data from Table_A and regarding what I have in the resultSet ,I'll insert into Table_2 that's the second table in the same database,I try using vector as a placeholder for the resultSet but accessing all the data from the first row to the last row is where i have an issue ,I use for loop to loop through the elements and i was able to display the last record on Table_A and I don't have clue of how to insert into Table_B
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
This question doesn't make any sense in the "meaningless drivel" forum, so I'm monving it to JDBC.


"I'm not back." - Bill Harding, Twister
lenin laker
Greenhorn

Joined: Apr 02, 2003
Posts: 10
Hi,
This is just a sample I am giving.
Open connection.
Read data from ResultSet to some Strings, Integers as of ur request.
Fire insert statement for each row want u read
While (Reading Table A resultSet)
{
//Talkeing the result row into java variables.
String ..
String..
con.execute (Fire insert for each row into table B)
}
is it clear?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Retreiving data from Table_A and at the same time inserting into Table_A
 
Similar Threads
More problems with file uploads
select vs count(*) - Performance Comparison
Auto increment key in Hibernate
access rows from html table
what is difference between JDBC1 and JDBC2 ?