sqlserver 2008 创建表 报错,但是表成功建立了
如下:
//关键代码
dao.create(SysAppInfo.class,false);
//实体类
@Table("sys_app_info")
public class SysAppInfo {
@Id
@Column("id")
private int id;
@Column("name")
private String name;
@Column("version")
private String version;
@Column("content")
@ColDefine(width = 2000)
private String content;
@Column("apk_path")
@ColDefine(width = 200)
private String apkPath;
@Column("apk_size")
private String apkSize;
set and ger ..............
}
日志如下
2015-12-26 09:53:29,428 org.nutz.mvc.impl.NutMessageLoader.load(NutMessageLoader.java:102) DEBUG - Message Loaded, size = 2
2015-12-26 09:53:29,429 org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:267) INFO - Setup application...
2015-12-26 09:53:29,429 org.nutz.ioc.impl.NutIoc.get(NutIoc.java:145) DEBUG - Get 'dao'<interface org.nutz.dao.Dao>
2015-12-26 09:53:29,434 org.nutz.dao.impl.jdbc.AbstractJdbcExpert.setupEntityField(AbstractJdbcExpert.java:102) DEBUG - Table 'sys_app_info' doesn't exist!
2015-12-26 09:53:29,437 org.nutz.dao.impl.jdbc.AbstractJdbcExpert.setupEntityField(AbstractJdbcExpert.java:102) DEBUG - Table 'sys_app_info' doesn't exist!
2015-12-26 09:53:29,441 org.nutz.dao.impl.sql.run.NutDaoExecutor._runStatement(NutDaoExecutor.java:313) DEBUG - CREATE TABLE sys_app_info(
id NUMERIC(8) IDENTITY,
name VARCHAR(50),
version VARCHAR(50),
content VARCHAR(2000),
apk_path VARCHAR(200),
apk_size VARCHAR(50),
PRIMARY KEY (id)
)
2015-12-26 09:53:29,444 com.alibaba.druid.filter.stat.StatFilter.mergeSql(StatFilter.java:147) ERROR - merge sql error, dbType sqlserver, sql :
CREATE TABLE sys_app_info(
id NUMERIC(8) IDENTITY,
name VARCHAR(50),
version VARCHAR(50),
content VARCHAR(2000),
apk_path VARCHAR(200),
apk_size VARCHAR(50),
PRIMARY KEY (id)
)
com.alibaba.druid.sql.parser.ParserException: syntax error, expect LPAREN, actual COMMA IDENTITY
at com.alibaba.druid.sql.parser.SQLExprParser.accept(SQLExprParser.java:1471)
at com.alibaba.druid.sql.dialect.sqlserver.parser.SQLServerExprParser.parseColumnRest(SQLServerExprParser.java:202)
at com.alibaba.druid.sql.parser.SQLExprParser.parseColumn(SQLExprParser.java:1484)
at com.alibaba.druid.sql.parser.SQLCreateTableParser.parseCrateTable(SQLCreateTableParser.java:75)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseCreate(SQLStatementParser.java:1320)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:155)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:121)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:116)
at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:53)
at com.alibaba.druid.filter.stat.StatFilter.mergeSql(StatFilter.java:145)
at com.alibaba.druid.filter.stat.StatFilter.createSqlStat(StatFilter.java:629)
at com.alibaba.druid.filter.stat.StatFilter.internalBeforeStatementExecute(StatFilter.java:397)
at com.alibaba.druid.filter.stat.StatFilter.statementExecuteBefore(StatFilter.java:345)
at com.alibaba.druid.filter.FilterEventAdapter.statement_execute(FilterEventAdapter.java:185)
at com.alibaba.druid.filter.FilterChainImpl.statement_execute(FilterChainImpl.java:2487)
at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.execute(StatementProxyImpl.java:137)
at com.alibaba.druid.pool.DruidPooledStatement.execute(DruidPooledStatement.java:421)
at org.nutz.dao.impl.sql.run.NutDaoExecutor._runStatement(NutDaoExecutor.java:317)
at org.nutz.dao.impl.sql.run.NutDaoExecutor.exec(NutDaoExecutor.java:50)
at org.nutz.dao.impl.DaoSupport$DaoExec.invoke(DaoSupport.java:264)
at org.nutz.dao.impl.sql.run.NutDaoRunner.run(NutDaoRunner.java:64)
at org.nutz.dao.impl.DaoSupport._exec(DaoSupport.java:219)
at org.nutz.dao.impl.DaoSupport.execute(DaoSupport.java:197)
at org.nutz.dao.impl.NutDao.execute(NutDao.java:967)
at org.nutz.dao.impl.jdbc.sqlserver2005.Sqlserver2005JdbcExpert.createEntity(Sqlserver2005JdbcExpert.java:81)
at org.nutz.dao.impl.EntityHolder.reloadEntity(EntityHolder.java:79)
at org.nutz.dao.impl.NutDao.create(NutDao.java:768)
at com.yh.app.webser.MainSetup.init(MainSetup.java:27)
at org.nutz.mvc.impl.NutLoading.evalSetup(NutLoading.java:270)
at org.nutz.mvc.impl.NutLoading.load(NutLoading.java:119)
at org.nutz.mvc.ActionHandler.<init>(ActionHandler.java:19)
at org.nutz.mvc.NutFilter.init(NutFilter.java:77)
at com.yh.app.webser.common.mvc.YHwebFilter.init(YHwebFilter.java:23)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:279)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:260)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:105)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4841)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5535)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:901)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:877)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at org.apache.catalina.startup.HostConfig.manageApp(HostConfig.java:1839)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:618)
at org.apache.catalina.mbeans.MBeanFactory.createStandardContext(MBeanFactory.java:565)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:301)
at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(DefaultMBeanServerInterceptor.java:819)
at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(JmxMBeanServer.java:801)
at javax.management.remote.rmi.RMIConnectionImpl.doOperation(RMIConnectionImpl.java:1471)
at javax.management.remote.rmi.RMIConnectionImpl.access$300(RMIConnectionImpl.java:76)
at javax.management.remote.rmi.RMIConnectionImpl$PrivilegedOperation.run(RMIConnectionImpl.java:1312)
at javax.management.remote.rmi.RMIConnectionImpl.doPrivilegedOperation(RMIConnectionImpl.java:1404)
at javax.management.remote.rmi.RMIConnectionImpl.invoke(RMIConnectionImpl.java:832)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:323)
at sun.rmi.transport.Transport$1.run(Transport.java:200)
at sun.rmi.transport.Transport$1.run(Transport.java:197)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.Transport.serviceCall(Transport.java:196)
at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:568)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run0(TCPTransport.java:826)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.lambda$run$256(TCPTransport.java:683)
at java.security.AccessController.doPrivileged(Native Method)
at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:682)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
2015-12-26 09:53:29,468 org.nutz.mvc.impl.NutLoading.load(NutLoading.java:139) INFO - Nutz.Mvc[nutz] is up in 1272ms