views:

49

answers:

1

How can I dump database schema to MySQL database with Java JDBC conncetor? I have my database schema in text file.

+1  A: 

The schema file is usually a series of SQL command. You should be able to send all those commands - at least one by one - via JDBC to the database. If your text file has a non-sql format, you will have to 'convert it to SQL' first.

Andreas_D
Ok, what If I use mysqldump command from shell? How can I do that ?
newbie
Pipe the mysqldump output to a new file (mysqldump ... > file.sql) and use it for input in your java application
Andreas_D
Ok thanx, I did split my sql file to queries and I executed every query one by one, just like you suggested...
newbie