01: /*
02: * DerbyConstraintReader.java
03: *
04: * This file is part of SQL Workbench/J, http://www.sql-workbench.net
05: *
06: * Copyright 2002-2008, Thomas Kellerer
07: * No part of this code maybe reused without the permission of the author
08: *
09: * To contact the author please send an email to: support@sql-workbench.net
10: *
11: */
12: package workbench.db.derby;
13:
14: import workbench.db.AbstractConstraintReader;
15:
16: /**
17: * Constraint reader for Cloudscape database
18: * @author support@sql-workbench.net
19: */
20: public class DerbyConstraintReader extends AbstractConstraintReader {
21: private static final String TABLE_SQL = "select 'check '|| c.checkdefinition \n"
22: + "from sys.syschecks c, sys.systables t, sys.sysconstraints cons, sys.sysschemas s \n"
23: + "where t.tableid = cons.tableid \n"
24: + "and t.schemaid = s.schemaid \n"
25: + "and cons.constraintid = c.constraintid \n"
26: + "and t.tablename = ? \n" + "and s.schemaname = ?";
27:
28: public DerbyConstraintReader() {
29: }
30:
31: public String getColumnConstraintSql() {
32: return null;
33: }
34:
35: public String getTableConstraintSql() {
36: return TABLE_SQL;
37: }
38:
39: public int getIndexForTableNameParameter() {
40: return 1;
41: }
42:
43: public int getIndexForSchemaParameter() {
44: return 2;
45: }
46: }
|