• Post Reply Bookmark Topic Watch Topic
  • New Topic

JDBCMetaData to Automate Sync Code?

 
Mike London
Ranch Hand
Posts: 1290
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is it possible to use JDBCMetadata to automate syncing one database to another?

For example, using JDBCMetaData, could I write generic JDBC code that would get the structure of the database in one location and then be able to sync/copy that database to another location?

(Without knowing any field names or field types from either database in advance -- getting this information from the JDBCMetaData.)

Thanks,

- mike
 
Dave Tolls
Ranch Hand
Posts: 2369
25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you mean DatabaseMetaData.

I expect it's possible, but you'd need to write code to create the DDL and populate the tables.
I would expect it to be fairly slow.

Most DBs come with schema dump systems which are designed for this sort of thing, or backup and restore if you want to do the whole thing.
 
Mike London
Ranch Hand
Posts: 1290
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dave Tolls wrote:I think you mean DatabaseMetaData.

I expect it's possible, but you'd need to write code to create the DDL and populate the tables.
I would expect it to be fairly slow.

Most DBs come with schema dump systems which are designed for this sort of thing, or backup and restore if you want to do the whole thing.


Yes, sorry about the Capitalization error.

Great info, Thanks for your reply.

-mike
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!