db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John English <john.fore...@gmail.com>
Subject Re: DriverManager.getConnection error with JDK 7
Date Sat, 23 Feb 2013 13:45:46 GMT
On 23/02/2013 13:21, john miltone wrote:
> Hi All,
>
> I am starting into Derby and I develop on Intellij IDEA with JDK 7.
>
> I just want to create and start database. It seems very simple but the first and
> unique code row generate a exception.
>
>          String createString = "CREATE TABLE operation " + "(operation_ID INT
> NOT NULL GENERATED ALWAYS AS IDENTITY " + " type VARCHAR(32) NOT NULL) " ;

Looks like you're missing a comma after AS IDENTITY; the statement should be:

   CREATE TABLE operation (
     operation_ID INT NOT NULL GENERATED ALWAYS AS IDENTITY,
     type VARCHAR(32) NOT NULL
   )

The exception is presumably reporting a syntax error, but since you didn't give 
details of the exception I can't be sure.

-- 
John English

Mime
View raw message