01: /*
02: * Copyright 2001-2007 Geert Bevin <gbevin[remove] at uwyn dot com>
03: * Distributed under the terms of either:
04: * - the common development and distribution license (CDDL), v1.0; or
05: * - the GNU Lesser General Public License, v2.1 or later
06: * $Id: org_postgresql_Driver.java 3634 2007-01-08 21:42:24Z gbevin $
07: */
08: package com.uwyn.rife.database.testdatabasedrivers;
09:
10: import com.uwyn.rife.database.Datasource;
11: import com.uwyn.rife.database.exceptions.DatabaseException;
12: import com.uwyn.rife.database.queries.CreateTable;
13: import com.uwyn.rife.database.queries.DropTable;
14:
15: public class org_postgresql_Driver extends generic {
16: public org_postgresql_Driver(Datasource datasource) {
17: super (datasource);
18:
19: mCreateStructure = new CreateTable(getDatasource()).table(
20: "TestTable").column("id", int.class,
21: CreateTable.NOTNULL).column("valuecol", String.class,
22: 32, CreateTable.NOTNULL).primaryKey("ID_PK", "id");
23:
24: mRemoveStructure = new DropTable(getDatasource())
25: .table(mCreateStructure.getTable());
26: }
27:
28: public boolean install() throws DatabaseException {
29: return _install(mCreateStructure);
30: }
31:
32: public boolean remove() throws DatabaseException {
33: return _remove(mRemoveStructure);
34: }
35: }
|