Subhash Pavuskar wrote:How to copy a table from one Schema to another Schema table In MySql ?
I'm not sure how this question is related to
Java, but you can do it with below query:
CREATE TABLE new_db.table_name LIKE old_db.table_name;
INSERT INTO new_db.table_name SELECT * FROM old_db.table_name;
First query would create a new table exactly like original table(i.e. retaining keys, indexes etc.) - just make sure that the table with same name does not exist in new db etc.
Second query would copy the data from original table to new table.
I hope this helps.
Regards,
Anayonkar Shivalkar (SCJP, SCWCD, OCMJD, OCEEJBD)