Reputation: 947
I am having a result set for a particular MySQL Query in Java. What I want to do is to generate the possible query for the generated result set so I can execute those statement to some other database with few modification in the statement. Is there any way i can do that in java?
Upvotes: 1
Views: 143
Reputation: 1612
After reading the comments and your question, it seems that you are trying to create insert queries based on the resultset values that you got and use them for data migration
To create insert statements first you need to have the column types of the table that you are trying to insert into the table as well as the resultset pulled from.
The former you can be easily predicted by viewing the table schema and the latter can be got by functiongetColumnType()
using ResultsetMetaData
object
So here you go,
This is just a small overview of how the migration process can be achieved. Hope this will provide a basic understanding on how the task can be done.
Upvotes: 1