01: package net.sourceforge.jaxor.example.db;
02:
03: import net.sourceforge.jaxor.util.SystemException;
04:
05: import java.sql.Types;
06:
07: /**
08: * Created By: Mike
09: * Date: Nov 28, 2003
10: * Time: 4:36:32 PM
11: *
12: * Last Checkin: $Author: mrettig $
13: * Date: $Date: 2004/01/24 17:53:47 $
14: * Revision: $Revision: 1.2 $
15: */
16: public class AxionContextTestingFactory extends
17: JaxorContextTestingFactoryImpl {
18:
19: public AxionContextTestingFactory() {
20: super (AxionConnection.INSTANCE.getConnection(), true);
21: }
22:
23: public String getCreateTable(int type) {
24: switch (type) {
25: case Types.VARCHAR:
26: return "STRING";
27: case Types.BIGINT:
28: return "LONG";
29: case Types.TIMESTAMP:
30: return "TIMESTAMP";
31: case Types.NUMERIC:
32: return "NUMBER";
33: case Types.BIT:
34: return "BOOLEAN";
35: case Types.INTEGER:
36: return "INTEGER";
37: case Types.DATE:
38: return "DATE";
39: case Types.TINYINT:
40: return "BYTE";
41: case Types.SMALLINT:
42: return "SHORT";
43: case Types.REAL:
44: return "FLOAT";
45: case Types.DOUBLE:
46: return "NUMBER";
47: default:
48: throw new SystemException("Unknown type: " + type);
49: }
50: }
51: }
|