views:

115

answers:

1

I have been trying to migrate a database from sybase to Mysql.

This is my approach:

  1. Generate pojo classes from my sybase database using hibernate in eclipse
  2. Use these pojo classes to generate the schema in mysql database
  3. Then somehow migrate the data from sybase to mysql

I guess this approach should work??? Please let me know if there is any better or easier approach.

The thing is I am not even able to get the first step done.

  1. I added hibernate plugin in eclipse from this link: [http://download.jboss.org/jbosstools/updates/stable/][1]
  2. I added sybase jar file to my project classpath
  3. Then I added hibernate console configuration file
  4. Then I added hibernate configuration file
  5. Then I added hibernate code generation configuration

When I try to run the code generation configuration file, I am getting java.lang.NullPointerException and I have no idea how to fix it.

I searched a lot of forums, tried to google it, but I not able to find any solution. Can anybody tell me what mistake I am making here or point to some hibernate tutorial for eclipse??

+1  A: 

one method would be to run a sql export on the database, change the schema as necessary, and then import the data into mysql.

if that's not acceptable, where are you getting the NPE?

edit: alternatively, try this page

oedo
I don't think sql export will work because both sybase and mysql have some differences in their sql structure and there are a lot of table in my database and I will then have to edit the sql code.Eclipse won't tell me where is the NPE is originating from. It just reports a null pointer exception in a popup window.
did you try any of the software on that page? in particular, http://www.ispirer.com/ seems to be what you want and has a free trial period...
oedo
I tried isperer a few days ago and I got a warning that it's a trial version. Let me try it again.
thanks, insperer does the work. It reported errors while inserting data into some tables (10 tables) due to foreign key constraints, so I had to delete these foreign keys from my original database and add them again after the process completes, but everything worked I guess.
cool, glad you got it working :)
oedo