1 package com.daffodilwoods.daffodildb.server.sql99.dml.declarecursor; 2 3 import com.daffodilwoods.daffodildb.server.sql99.dql.iterator.*; 4 5 16 public class Cursor implements _Cursor { 17 18 public String sensitivity, cursorName; 19 boolean holdability, returnability, scrollability, updatabilityClause, state, iteratorState; 20 String [] columnNames; 21 private _Iterator iterator; 22 cursorspecification _cursorSpecification; 23 private boolean isFirstFetchStatementFired = false; 24 25 34 public Cursor(String sensitivty, boolean holdablty, boolean returnablty, boolean scrollablty, String Cname, cursorspecification cursorSpec) { 35 sensitivity = sensitivty; 36 holdability = holdablty; 37 returnability = returnablty; 38 scrollability = scrollablty; 39 cursorName = Cname; 40 _cursorSpecification = cursorSpec; 41 } 42 43 47 public void setCursorState(boolean flag) { 48 state = flag; 49 } 50 51 56 public void addIterator(_Iterator iter) { 57 iterator = iter; 58 } 59 60 66 public Object getCursorSpecification() { 67 return _cursorSpecification; 68 } 69 70 74 public boolean getCursorState() { 75 return state; 76 } 77 78 82 public String getCursorSensitivity() { 83 return sensitivity; 84 } 85 86 90 public boolean getCursorHoldability() { 91 return holdability; 92 } 93 94 98 public boolean getCursorScrollability() { 99 return scrollability; 100 } 101 102 108 public void setUpdatabilityClause(boolean flag, String [] columns) { 109 updatabilityClause = flag; 110 columnNames = columns; 111 } 112 113 117 public void close() { 118 setCursorState(false); 119 _cursorSpecification = null; 120 iterator = null; 121 } 122 123 127 public String getCursorName() { 128 return cursorName; 129 } 130 131 135 public _Iterator getIterator() { 136 return iterator; 137 } 138 139 143 public boolean getUpdatabilityClause() { 144 return updatabilityClause; 145 } 146 147 public String toString() { 148 return " CURSOR -- [ Name : " + cursorName + " || Holdability : " + holdability + " || Scrollability : " + scrollability + " || Sensitivity : " + sensitivity + " || Returnability : " + returnability + " || Updatability : " + updatabilityClause + " ] "; 149 } 150 151 public void setIteratorState(boolean bool) { 152 iteratorState = bool; 153 } 154 155 public boolean getIteratorState() { 156 return iteratorState; 157 } 158 159 163 public boolean isFetchStatementFired() { 164 return isFirstFetchStatementFired; 165 } 166 167 171 public void setFetchStatementFired(boolean flag) { 172 isFirstFetchStatementFired = flag; 173 } 174 } 175 | Popular Tags |