This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes JavaDb creating table error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JavaDb creating table error" Watch "JavaDb creating table error" New topic
Author

JavaDb creating table error

Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
this is my first tsble


i have created this tasble on JavaDb

when i am going to creat the next table it gives error
this is the next table script



here is the eror


screenshot is here

http://4.bp.blogspot.com/_bpkZ2BsqXug/S21OLQkrVUI/AAAAAAAAAF0/i2rOxn4pHJA/s1600-h/db.gif
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
hi,

see http://www.w3schools.com/SQl/sql_foreignkey.asp

just add a "," after
DEPT_ID" INTEGER



1. CREATE TABLE "Student" (
2. "ID" INTEGER not null primary key,
3. "NAME" VARCHAR(30),
4. "DEPT_ID" INTEGER,
5. FOREIGN KEY (DEPT_ID) REFERENCES DEPARTMENT(DEPT_ID)
6. );
Samanthi perera
Ranch Hand

Joined: Jan 08, 2010
Posts: 510
Now i have inserting data to table

http://1.bp.blogspot.com/_bpkZ2BsqXug/S217oetgpFI/AAAAAAAAAF8/bpl8RBPqwXw/s1600-h/db.bmp

http://2.bp.blogspot.com/_bpkZ2BsqXug/S219cnKYOiI/AAAAAAAAAGE/hKaAN_rq1LE/s1600-h/db2.GIF

what is this error?
Herman Schelti
Ranch Hand

Joined: Jul 17, 2006
Posts: 387
Now i have inserting data to table


No, you are "nserting" ....
 
jQuery in Action, 2nd edition
 
subject: JavaDb creating table error
 
Similar Threads
hibernate 1:M relationships & cascade
Hypersonic DB question
Why sql exception happens?
SQL Error
Issue while update the parent recored and removed some child records