Problem creating cache registration table in MySQL

User 9f6f294e9f

21-12-2010 10:34:32

Hi


I'm attempting to use JchemManager 5.4.0.1 to create a structure table in a MySQL 5.5 database. JchemManager is able to create the jchemproperties table but is erroring when attempting to create the cache table:


com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in
your SQL syntax; check the manual that corresponds to your MySQL server version
for the right syntax to use near 'TYPE=INNODB' at line 6
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)


        at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)


        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Sou
rce)
        at java.lang.reflect.Constructor.newInstance(Unknown Source)
        at com.mysql.jdbc.Util.handleNewInstance(Util.java:407)
        at com.mysql.jdbc.Util.getInstance(Util.java:382)
        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3593)
        at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3525)
        at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1986)
        at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2140)
        at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2620)
        at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1662)
        at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1581)
        at chemaxon.jchem.db.TableInfo.executeSql(TableInfo.java:806)
        at chemaxon.jchem.db.TableInfo.createCacheRegistrationTable(TableInfo.ja
va:521)
        at chemaxon.jchem.db.TableInfo.createCacheRegistrationTableWithProperty(
TableInfo.java:531)
        at chemaxon.jchem.db.Updater.createCacheTables(Updater.java:915)
        at chemaxon.jchem.db.Updater.performCurrentUpdate(Updater.java:211)
        at chemaxon.jchem.gui.Connector.performUpdate(Connector.java:135)
        at chemaxon.jchem.gui.Connector.go(Connector.java:98)
        at chemaxon.jchem.gui.JChemFrame.connect(JChemFrame.java:619)
        at chemaxon.jchem.gui.JChemFrame.connectMenuItemActionPerformed(JChemFra
me.java:468)
        at chemaxon.jchem.gui.JChemFrame.connectButtonActionPerformed(JChemFrame
.java:463)
        at chemaxon.jchem.gui.JChemFrame.access$1500(JChemFrame.java:31)
        at chemaxon.jchem.gui.JChemFrame$16.actionPerformed(JChemFrame.java:350)


        at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
        at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
        at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
        at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Sour
ce)
        at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
        at java.awt.Component.processMouseEvent(Unknown Source)
        at javax.swing.JComponent.processMouseEvent(Unknown Source)
        at java.awt.Component.processEvent(Unknown Source)
        at java.awt.Container.processEvent(Unknown Source)
        at java.awt.Component.dispatchEventImpl(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
        at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
        at java.awt.Container.dispatchEventImpl(Unknown Source)
        at java.awt.Window.dispatchEventImpl(Unknown Source)
        at java.awt.Component.dispatchEvent(Unknown Source)
        at java.awt.EventQueue.dispatchEvent(Unknown Source)
        at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
        at java.awt.EventDispatchThread.run(Unknown Source)


If you can post the sql that should work I'll create the table manually.


Thanks


Ant

ChemAxon ebbce65bcf

21-12-2010 19:45:08

Hi,


As I see, the problem is that the TYPE keyword has been deprecated since Mysql 5.5. Try to use ENGINE keyword instead.


The query is


CREATE TABLE jchemproperties_CR (


cache_id VARCHAR(32) NOT NULL,


registration_time VARCHAR(30) NOT NULL,


is_protected TINYINT(1) DEFAULT 0 NOT NULL,


CONSTRAINT cache_382740272_pk PRIMARY KEY (cache_id))


ENGINE=INNODB;


where the 9-digit number in PK-constraint is generated randomly, thus can be anything, Please, tell us, if you succeed to create this table or not, and let us know if you come across any other issues. Thanks for reporting the problem, it will be fixed in the next version.


Regards,


Roland

User 9f6f294e9f

22-12-2010 09:37:41

Hi Roland


Yes, that amended syntax worked perfectly. Thanks for your help.


Regards


Ant