Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBCMetaData to Automate Sync Code?

 
Mike London
Ranch Hand
Posts: 1216
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: 2091
15
  • 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: 1216
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic