1 33 package smallsql.database; 34 35 import java.sql.*; 36 54 abstract class RowSource { 55 56 57 60 abstract boolean isScrollable(); 61 62 65 abstract void beforeFirst() throws Exception ; 66 67 68 69 72 boolean isBeforeFirst() throws SQLException{ 73 throw Utils.createSQLException("ResultSet is forward only."); 74 } 75 76 79 boolean isFirst() throws SQLException{ 80 throw Utils.createSQLException("ResultSet is forward only."); 81 } 82 83 84 88 abstract boolean first() throws Exception ; 89 90 boolean previous() throws Exception { 91 throw Utils.createSQLException("ResultSet is forward only."); 92 } 93 94 abstract boolean next() throws Exception ; 95 96 97 boolean last() throws Exception { 98 throw Utils.createSQLException("ResultSet is forward only."); 99 } 100 101 102 105 boolean isLast() throws Exception { 106 throw Utils.createSQLException("ResultSet is forward only."); 107 } 108 109 112 boolean isAfterLast() throws SQLException, Exception { 113 throw Utils.createSQLException("ResultSet is forward only."); 114 } 115 116 117 abstract void afterLast() throws Exception ; 118 119 120 boolean absolute(int row) throws Exception { 121 throw Utils.createSQLException("ResultSet is forward only."); 122 } 123 124 125 boolean relative(int rows) throws Exception { 126 throw Utils.createSQLException("ResultSet is forward only."); 127 } 128 129 130 abstract int getRow() throws Exception ; 131 132 133 134 141 abstract long getRowPosition(); 142 143 147 abstract void setRowPosition(long rowPosition) throws Exception ; 148 149 153 abstract void nullRow(); 154 155 159 abstract void noRow(); 160 161 162 165 abstract boolean rowInserted(); 166 167 170 abstract boolean rowDeleted(); 171 172 177 boolean hasAlias(){ 178 return true; 179 } 180 181 182 void setAlias(String name) throws SQLException{ 183 throw Utils.createSQLException("Alias not supported for this type of row source." ); 184 } 185 186 190 abstract void execute() throws Exception ; 191 192 } | Popular Tags |