异常意外标记:SMALLINT;同时自动增加主键

Exception unexpected token: SMALLINT; while AUTOINCREMENTing PRIMARY KEY

以下是我的一段代码。但是当我执行以下异常时会生成。 net.ucanaccess.jdbc.UcanaccessSQLException:意外标记:SMALLINT

   String sql= "CREATE TABLE "+emailId.getText()+"Inbox (id integer PRIMARY KEY AUTOINCREMENT,fromId varchar(50), InMsgs varchar(200))";
   Class.forName("net.ucanaccess.jdbc.UcanaccessDriver");
   con=DriverManager.getConnection("jdbc:ucanaccess://path/Email.accdb");
            st=con.createStatement();
            con.setAutoCommit(false);

            check2=st.executeUpdate(sql);

我正在使用 MSAccess 数据库,Java netbeans 中的 SE 8 和 UCanAccess 2.0.9.4。 有什么问题

您的查询应该是这样的

CREATE TABLE "+emailId.getText()+"Inbox 
(id AUTOINCREMENT PRIMARY KEY ,
fromId varchar(50), 
InMsgs varchar(200))

AUTOINCREMENT 已指定,因此不需要 'Integer'。另外 Primary Key 关键字应该在数据类型之后。