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 15 public class SelectDuplicationResults extends TKCallableQuery implements QueryConstants{ 16 17 18 public final static boolean isPrepared = 19 true; 20 21 public final static String [] paramOrder = 22 { 23 "DUMMY", 24 TKDBDuplicateQuery.TEMPLATE_ROOT_ID, 25 TKDBDuplicateQuery.ST_SUBTREE_ROOT_ID 26 } 27 ; 28 29 public final static Object [][] paramTypes = 30 null; 31 32 public final static boolean[] setRelevants = 33 null; 34 35 public final static String sqlString = 36 37 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 (e.getMessage()); 58 } 59 60 } 61 62 65 public void specClose() throws SQLException{ 66 if (stmt != null) 67 { 68 stmt.close(); 69 } 70 } 71 72 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 (e.getMessage()); 93 } 94 return rs; 95 96 } 97 } 98 99 | Popular Tags |