01: package simpleorm.core;
02:
03: /** This contains Sybase Adaptive Server specific code.
04: */
05:
06: public class SDriverSybase extends SDriver {
07:
08: protected String driverName() {
09: return "jConnect (TM) for JDBC (TM)";
10: }
11:
12: /** Sybase only understands DATETIME (and SMALLDATETIME) and timestamp (must be lc!)*/
13: protected String columnTypeSQL(SFieldMeta field) {
14: if (((String) field.getProperty(SDATA_TYPE))
15: .equals("TIMESTAMP"))
16: return "timestamp";
17: if (((String) field.getProperty(SDATA_TYPE)).equals("DATE"))
18: return "datetime";
19: if (((String) field.getProperty(SDATA_TYPE)).equals("TIME"))
20: return "datetime";
21: else
22: return super .columnTypeSQL(field);
23: }
24:
25: protected String forUpdateSQL(boolean forUpdate) {
26: return "";
27: }
28:
29: /** MSSQL and Sybase do not support FOR UPDATE. But the docs say to use WITH
30: (XLOCK). But Jorge says that it is unnecessary and makes
31: SimpleORM fail. Very odd. */
32: protected String postFromSQL(boolean forUpdate) {
33: // if (forUpdate) return " WITH (XLOCK)";
34: return "";
35: }
36: }
|