Migrating Existing MySQL Tables

I thought I had this worked ou t but I guess not because now I can’t add data to tables.

I am running on Windows XP and have the latest MySQL installed. The mysqld is running, and I created some tables. The auto setup server worked fine and I can see my tables once I created a new solution and copied the tables in from the mysql/data directory. Creating forms went fine, and I can select New Record from the Select menu (the primary key increments fine) but when I click out of the first field I get the following:

“java.sql.SQLException: General error: Table handler for ‘products’ doesn’t have this option General error: Table handler for ‘products’ doesn’t have this option”

Of course this problem doesn’t arise when the solution and associated tables were created via Servoy itself. What am I missing? Thanks,

Jon

Does that table has a PK
And does servoy reconize those keys?
(what does the dataprovider dialog of that table say?)

If you create a table with servoy it works just fine? With the exact same mysql version and jdbc driver?

If you click outside a field it tries to insert the record
it seems that that insert is somehow going wrong (it generates the wrong insert statement)

maybe you can change the servoy_developer.bat like this:
java -DSTACKTRACE=true -jar servoy_developer.jar

(so start it with java instead of javaw en use the -DSTACKTRACE setting to get some more info)

Then you will see something like this in the command window:

sql insert into test( testid, naam, naam2) values ( ? , ? , ? )
questiondata[0] 1
questiondata[1] NullValue with type: 12
questiondata[2] NullValue with type: 12

look what kind of sql is generated for youre tables.

Do those already existing tables have PK’s that are auto increment?

Currently servoy doesn’t see or know that and tries to insert a pk anyway. But i have tested this yet and my mysql version 4.0.12 doesn’t seem to care about servoy inserting there own PK (it just takes that one if it not violates the current PK and after that it just increments from that one)

Yes the tables had autoincrement primary keys, I created the tables with a GUI tool called SQLyog (not at the command line, and I haven’t tested that option yet).

You are right, after a bit Servoy just accepts it. I wanted to dig into Servoy (love it) but will test it out more and report back. Thanks,

Jon

Probably this is not the case but … mysql is case sensitive while Servoy creates and uses field name in lowercase. Check the field name formatting and change the field name in lowercase.

bye