CodeKingPlusPlus
CodeKingPlusPlus

Reputation: 16081

Migrating from Apache Derby to MySQL

I have a JDBC application that uses Apache Derby. How can I migrate my entire database system to use MySQL?

  1. I have 3 Java programs that access the database
  2. I have 3 tables and 2 views

I am using Netbeans. I have never used MySQL before and do not know where to begin. Is there nice integration with Java and MySQL in Netbeans? How can I get nice integration with NetBeans and MySQL?

All help is greatly appreciated!

Upvotes: 1

Views: 3282

Answers (2)

Pete B.
Pete B.

Reputation: 3286

I found this tutorial on the Spring site, but I think it is only a partial solution.

Tutorial

In it they are relying on hibernate to drop and create the tables, and I really don't like that. You have to go through special coding to add static data. For example, if your app is tracking devices, you probably want a table of device_types. At least some o those device types will be in the db, as well as devices, users, etc.

What I intend to do, is to use Derby until I am somewhat stable. From it, I will get the database schema and create it in mysql. It seems that the DB look utility can be used for that. DB Look

As added security I intend to run my web app with a db user that does not have the ability to add or drop tables. Also it is possible to remove the permission to delete rows if you use the concept of making rows "inactive" So instead of deleting a no longer used device type, you set the "active" flag to F. So your device type query would look like:

select * from device_type where active = 'T'

Upvotes: 0

Larry Hector
Larry Hector

Reputation: 183

Looks like this plugin would probably help you: http://netbeans.org/kb/docs/ide/mysql.html

Upvotes: 2

Related Questions