• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Invalid SQL from

 
Jan Buchholdt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear friends,

I’m new to JPA and am testing it out on HSQL using Toplink, GlassFish 2 and Netbeans.

I have a simple bean TestData that I am trying to persist.


The SQL that is generated is invalid and I get the following error in the log:

Internal Exception: java.sql.SQLException: Wrong data type: NUMBER in statement [CREATE TABLE TESTDATA (ID NUMBER]
Error Code: -16
Call: CREATE TABLE TESTDATA (ID NUMBER(10) NOT NULL, TESTSTRING VARCHAR(255), PRIMARY KEY (ID))
Query: DataModifyQuery()

What am I doing wrong?
It seems so simple. I know this SQL will work in Oracle but not in HSQL. Is Toplink only for oracle or is there a way to configure it to generate valid SQL for different servers?

Thanks,
 
Jan Buchholdt
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found it myself



thanks to

http://dayg.wordpress.com/2008/05/14/toplink-jpa-and-hsqldb-quirk/
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic