MySQL to Oracle Migration (with JPA)

MySQL is relatively new to me. I’ve played around with it before, and had to do some assignments with it during my Masters course about 12 months ago.

Oracle is completely new to me. As is JPA.

I’m getting there slowly though, and I’ve got a EJB / JPA book on order, so hopefully I’ll be up to speed fairly soon.

However, I’ve been tasked with migrating some code (and data) from MySQL to Oracle. One of the many hurdles I’ve encountered up to now was an exception along the lines of:

Exception raised: 
Exception [TOPLINK-4002] (Oracle TopLink Essentials - 2.0.1 (Build b09d-fcs (12/06/2007))): oracle.toplink.essentials.exceptions.DatabaseException
...
Internal Exception: java.sql.SQLException: ORA-00936: missing expression
Error Code: 936
Call: SELECT <<fields>> FROM <<table>> WHERE (<<field> = ?)
 bind => [<<value>>]
Query: ReadAllQuery(package.className)|#]

Having search around for a while, and ignoring some seemingly unrelated Google search results, I pasted the reported query into my Oracle Query Runner – to find that I was using a reserved keyword as 1 of the tables field names. The advice of running the query analyzer had been mentioned in the search results, I just choose to ignore it as the examples posted weren’t identical to mine! D’Oh.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s