01: /*
02: * $Header: /cvsroot/webman-cms/source/webman/com/teamkonzept/field/db/queries/sybase/TKDBFormNew.java,v 1.1 2001/10/15 10:03:51 markus Exp $
03: *
04: */
05: /**
06: * Jedes Selectstatement erhaelt eine eigene Klasse
07: */package com.teamkonzept.field.db.queries.sybase;
08:
09: import java.sql.*;
10:
11: import com.teamkonzept.db.*;
12:
13: /**
14: * @author
15: * @version
16: */
17: public class TKDBFormNew extends TKPrepQuery {
18:
19: public final static boolean ISPREPARED = true;
20: public final static String[] PARAMORDER = { "FORM_TYPE",
21: "FORM_TYPE" };
22: public final static Object[][] PARAMTYPES = null;
23: public final static boolean[] SETRELEVANTS = { true };
24:
25: public final static String SQLSTRING = "DECLARE @ID INT " +
26:
27: "BEGIN TRANSACTION " +
28:
29: "SELECT " + " @ID=ISNULL(MAX(FORM_ID)+1, 1) " + "FROM " + " FORM "
30: +
31:
32: "INSERT INTO " + "FORM " + " (FORM_ID, FORM_TYPE) "
33: + "VALUES(@ID, ?) " +
34:
35: "COMMIT TRANSACTION " +
36:
37: "SELECT " + " @ID AS FORM_ID, ? AS FORM_TYPE ";
38:
39: public void initQuery(Connection con) {
40: super.initQuery(con, ISPREPARED, PARAMORDER, PARAMTYPES,
41: SETRELEVANTS, SQLSTRING);
42: }
43: }
|