KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > teamkonzept > webman > mainint > db > queries > duplication > oracle > SelectDuplicationResults


1 package com.teamkonzept.webman.mainint.db.queries.duplication.oracle;
2
3 import com.teamkonzept.db.*;
4 import com.teamkonzept.webman.mainint.DatabaseDefaults;
5
6 import java.io.*;
7 import java.util.*;
8 import java.sql.*;
9
10 import oracle.jdbc.driver.*;
11
12 /**
13     @author Marwan
14  */

15 public class SelectDuplicationResults extends TKCallableQuery implements QueryConstants{
16
17     
18     public final static boolean isPrepared =
19         true;
20     
21     public final static String JavaDoc[] paramOrder =
22         {
23         "DUMMY", /* damit die :1 von execute() 'uebersprungen' wird */
24         TKDBDuplicateQuery.TEMPLATE_ROOT_ID,
25         TKDBDuplicateQuery.ST_SUBTREE_ROOT_ID
26         }
27         ;
28
29     public final static Object JavaDoc[][] paramTypes =
30         null;
31                 
32     public final static boolean[] setRelevants =
33         null;
34         
35     public final static String JavaDoc sqlString =
36
37         /* "{ ? = call duplication.select_results() }"; */
38         
39         " begin :1 := duplication.select_results(:2,:3); end; "
40      ;
41         
42     public void initQuery(Connection con) {
43         super.initQuery(
44             con,
45             isPrepared,
46             paramOrder,
47             paramTypes,
48             setRelevants,
49             sqlString );
50             
51         
52         CallableStatement cStmt = (CallableStatement) stmt;
53         try{
54             cStmt.registerOutParameter(1, OracleTypes.CURSOR);
55         }
56         catch(SQLException e){
57             throw new Error JavaDoc(e.getMessage());
58         }
59         
60     }
61     
62     /**
63         TKPrepQuery.specClose() is being overridden to avoid reuse of this object
64      */

65     public void specClose() throws SQLException{
66         if (stmt != null)
67             {
68                 stmt.close();
69             }
70     }
71     
72     /*
73     public boolean execute()throws SQLException{
74         CallableStatement cStmt = (CallableStatement) stmt;
75         cStmt.clearParameters();
76         try{
77             cStmt.registerOutParameter(1, OracleTypes.CURSOR);
78         }
79         catch(SQLException e){
80             throw new Error(e.getMessage());
81         }
82         return super.execute();
83     }
84     */

85     public ResultSet fetchResultSet(){
86         CallableStatement cStmt = (CallableStatement) stmt;
87         ResultSet rs;
88         try{
89             rs = (ResultSet) cStmt.getObject(1);
90         }
91         catch(SQLException e){
92             throw new Error JavaDoc(e.getMessage());
93         }
94         return rs;
95         
96     }
97 }
98
99
Popular Tags