How to create table based on JDBC Result Set

后端 未结 5 1918
春和景丽
春和景丽 2020-12-18 15:24

I am building a reporting tool and I need to execute queries on remote databases and store the result set in my own database (because I do not have write permission on remot

5条回答
  •  猫巷女王i
    2020-12-18 16:09

    You probably have the ResultSet based on an execution of a select query.Now instead of getting the ResultSet and then iterating through it to create the table, we can also execute a single query for table creation.

    Your original query:

    select * from table_name

    Instead of executing this and iterating, execute this

    create table new_table_name as (select * from table_name)

提交回复
热议问题