01: package simpleorm.core;
02:
03: /**
04: * Contains Derby/Cloudscape 10.0 implementation
05: *
06: * $Revision: 1.0 $
07: * $Date: Apr 12 2004 14:33:46 $
08: * @author Denis Rodrigues Cassiano deniscassiano@gmail.com
09: */
10: public class SDriverDerby extends SDriver {
11:
12: // protected String driverName() {
13: // return "IBM DB2 JDBC Universal Driver Architecture"; // new type 4
14: // //return "IBM DB2 JDBC 2.0 Type 2"; // old type 2
15: // }
16:
17: protected String driverName() {
18: return "Derby Database Engine Driver";
19: }
20:
21: /** Derby supports different locking levels, but no FOR UPDATE
22: with ORDER BY.
23: * So supportsLocking returns false for now ...
24: * */
25: public boolean supportsLocking() {
26: return false;
27: } // ### not right.
28:
29: public int maxIdentNameLength() {
30: return 18;
31: } // Yes, only 18 chars!
32:
33: /** DB2 does not allow just NULL. */
34: protected void addNull(StringBuffer sql, SFieldMeta fld) {
35: if (fld.isPrimaryKey || fld.getBoolean(SMANDATORY))
36: sql.append(" NOT NULL");
37: }
38:
39: // /* (non-Javadoc)
40: // * @see simpleorm.core.SDriver#quoteColumn(java.lang.String)
41: // */
42: // public String quoteColumn(String ident) {
43: //
44: // return ident;
45: // }
46: // /* (non-Javadoc)
47: // * @see simpleorm.core.SDriver#quoteConstraint(java.lang.String)
48: // */
49: // public String quoteConstraint(String ident) {
50: // return ident;
51: // }
52: // /* (non-Javadoc)
53: // * @see simpleorm.core.SDriver#quoteIdentifier(java.lang.String)
54: // */
55: // public String quoteIdentifier(String ident) {
56: // return ident;
57: // }
58: // /* (non-Javadoc)
59: // * @see simpleorm.core.SDriver#quoteTable(java.lang.String)
60: // */
61: // public String quoteTable(String ident) {
62: // return ident;
63: // }
64: }
|