简体   繁体   English

为什么我的Sql代码在Java的Derby中不起作用?

[英]Why is my Sql code not working in Derby in java?

I am using eclipse and following http://www.eclipse.org/articles/article.php?file=Article-EclipseDbWebapps/index.html and it all works fine except when I try to run my own sql code. 我正在使用eclipse,并遵循http://www.eclipse.org/articles/article.php?file=Article-EclipseDbWebapps/index.html进行操作 ,除非我尝试运行自己的sql代码,否则一切正常。 Here it is: 这里是:

CREATE TABLE honscores (
  idhonscores INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
  Name varchar(25) NOT NULL,
  Characters VARCHAR(25) NOT NULL,
  Kills integer(11) NOT NULL,
  Deaths integer(11) NOT NULL,
  Assists integer(11) NOT NULL,
  XPM integer(11) NOT NULL,
  CK integer(11) NOT NULL);

Any help will be appreciated. 任何帮助将不胜感激。

Here is the error message : 这是错误消息:

Syntax error: Encountered "(" at line 5, column 20. 语法错误:在第5行第20列遇到“(”)。

Elapsed Time: 0 hr, 0 min, 0 sec, 0 ms. 经过的时间:0小时,0分钟,0秒,0毫秒。

CREATE TABLE app.honscores ( //schema name is before the table name
  idhonscores INTEGER PRIMARY KEY GENERATED ALWAYS AS IDENTITY (START WITH 1, INCREMENT BY 1),
  Name varchar(25) NOT NULL,
  Characters VARCHAR(25) NOT NULL,
  Kills integer NOT NULL,
  Deaths integer NOT NULL,
  Assists integer NOT NULL,
  XPM integer NOT NULL,
  CK integer NOT NULL
);

Im pretty sure this is how I fixed it 我很确定这是我修复的方式

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM