[nbusers] Re: Adding foreign keys to a Java DB database

  • From: Ricardo Palomares Martínez < >
  • To:
  • Subject: [nbusers] Re: Adding foreign keys to a Java DB database
  • Date: Fri, 12 Oct 2012 15:49:20 +0200

El 12/10/12 15:03, Ricardo Palomares Martínez escribió:
> I wonder if there is any UI (apart from a SQL input box) to set
> foreign keys while creating a database structure in the Services ->
> Databases window. I'm using NetBeans 7.2 on Linux and I have been
> looking up for plugins or docs, but I haven't found anything useful to
> create foreign keys.
> 
> If there is no such thing, do you know of any free tool to do it that
> works with Derby/Java DB? Squirrel client allows to see them, but
> apparently can't be used to create them.


Nevermind, Squirrel Client 3.6 allows to set them following these steps:

- Right-click the table you want to add a foreign key to.
- Choose Refactoring -> Referencial integrity -> Add foreign key

A dialog appears allowing you to name the FK restriction, to choose
the table and, in a separate tab, to add local/referenced columns pairs.

The equivalent option to drop a foreign key fails due to a SQL syntax
error. You can use the context menu to show the dialog and then choose
"Edit SQL". I've found several errors in the SQL statement: a
duplicate database qualification, extra unpaired quotes and an extra
"RESTRICT" modifier. Fortunately, even for SQL newbies like me, the
error messages are useful since they mark the exact character where
the error has been found.





[nbusers] Adding foreign keys to a Java DB database

Ricardo Palomares Martínez 10/12/2012

[nbusers] Re: Adding foreign keys to a Java DB database

Ricardo Palomares Martínez 10/12/2012

[nbusers] Re: Adding foreign keys to a Java DB database

Antonio Varela 10/12/2012

Project Features

About this Project

www was started in November 2009, is owned by jpirek, and has 21 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20131025.e7cbc9d). © 2013, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close