01: package simpleorm.core;
02:
03: /**
04: * Contains DB2/400 (iSeries DB2/Implementation tested on OS400 v5.1)
05: *
06: * CHAR/VARCHAR max 255 else LONG VARCHAR. CHARS are auto trimed on retrieval.
07: * '' is not null (unlike ORACLE).
08: *
09: * @author Eric Merritt
10: */
11: public class SDriverDB2 extends SDriver {
12:
13: protected String driverName() {
14: return "IBM DB2 JDBC Universal Driver Architecture"; // new type 4
15: //return "IBM DB2 JDBC 2.0 Type 2"; // old type 2
16: }
17:
18: public int maxIdentNameLength() {
19: return 18;
20: } // Yes, only 18 chars!
21:
22: /** DB2 does not allow just NULL. */
23: protected void addNull(StringBuffer sql, SFieldMeta fld) {
24: if (fld.isPrimaryKey || fld.getBoolean(SMANDATORY))
25: sql.append(" NOT NULL");
26: }
27:
28: }
|