File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Hypersonic DB question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Hypersonic DB question" Watch "Hypersonic DB question" New topic
Author

Hypersonic DB question

Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
Trying to follow a tutorial here

Tutorial

Running this script in order to create tables:



However, the ITEM table is not created. It keeps telling me that



What is the meaning of this error? What do I need to change to make it work???

Thanks, I am quite new to this.


We must know, we will know. -- David Hilbert
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2500
    
    8

You need to provide a unique name for your constraint.

You name your constraint SYS_FK_SUPPLIER for table SUPPLIER,
and you also try to create a constraint with the same name for table ITEM.

Try someting like ... CONSTRAINT <TABLENAME>_FK_SUPPLIER.

Regards, Jan


OCUP UML fundamental and ITIL foundation
youtube channel
Joseph Sweet
Ranch Hand

Joined: Jan 29, 2005
Posts: 327
Thanks. What does CONSTRAINT mean?

I could not find anything about it on Google.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2500
    
    8

A constraint is a validation mechanism.
It will guard that the data that you write adheres to your rules.

Your constraint CONSTRAINT SYS_STOREACCESS_UQ UNIQUE(USERNAME) will allow only unique values in column USERNAME.
If your table STOREACCESS has a record with USERNAME == 'Joseph Sweet', and you try to insert a new record with USERNAME == 'Joseph Sweet', it will fail.
Also updating another record to set USERNAME == 'Joseph Sweet' will fail.

Your constraint guarantees that USERNAME will only have unique values. No duplicates are allowed.

Regards, Jan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Hypersonic DB question