summaryrefslogtreecommitdiff
path: root/src/interfaces/jdbc/org/postgresql/jdbc2/UpdateableResultSet.java
blob: c5e7c2a4bfa436f6b889f1e8e0ef55a833d49aca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
package org.postgresql.jdbc2;

// IMPORTANT NOTE: This is the begining of supporting updatable ResultSets.
// It is not a working solution (yet)!
//
// You will notice here we really do throw org.postgresql.Driver.notImplemented()
// This is because here we should be updateable, so any unimplemented methods
// must say so.
//
// Also you'll notice that the String columnName based calls are not present.
// They are not required as they are in the super class.
//

import java.lang.*;
import java.io.*;
import java.math.*;
import java.text.*;
import java.util.*;
import java.sql.*;
import org.postgresql.Field;
import org.postgresql.largeobject.*;
import org.postgresql.util.*;

/**
 * @see ResultSet
 * @see ResultSetMetaData
 * @see java.sql.ResultSet
 */
public class UpdateableResultSet extends org.postgresql.jdbc2.ResultSet
{

	/**
	 * Create a new ResultSet - Note that we create ResultSets to
	 * represent the results of everything.
	 *
	 * @param fields an array of Field objects (basically, the
	 *	ResultSet MetaData)
	 * @param tuples Vector of the actual data
	 * @param status the status string returned from the back end
	 * @param updateCount the number of rows affected by the operation
	 * @param cursor the positioned update/delete cursor name
	 */
	public UpdateableResultSet(Connection conn, Field[] fields, Vector tuples, String status, int updateCount, int insertOID, boolean binaryCursor)
	{
		super(conn, fields, tuples, status, updateCount, insertOID, binaryCursor);
	}

	/**
	 * Create a new ResultSet - Note that we create ResultSets to
	 * represent the results of everything.
	 *
	 * @param fields an array of Field objects (basically, the
	 *	ResultSet MetaData)
	 * @param tuples Vector of the actual data
	 * @param status the status string returned from the back end
	 * @param updateCount the number of rows affected by the operation
	 * @param cursor the positioned update/delete cursor name
	 */
	//	public UpdateableResultSet(Connection conn, Field[] fields, Vector tuples, String status, int updateCount)
	//	{
	//	   super(conn,fields,tuples,status,updateCount,0,false);
	//}

	public void cancelRowUpdates() throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void deleteRow() throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public int getConcurrency() throws SQLException
	{
		// New in 7.1 - The updateable ResultSet class will now return
		// CONCUR_UPDATEABLE.
		return CONCUR_UPDATABLE;
	}

	public void insertRow() throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void moveToCurrentRow() throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void moveToInsertRow() throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public boolean rowDeleted() throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
		//return false; // javac complains about not returning a value!
	}

	public boolean rowInserted() throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
		//return false; // javac complains about not returning a value!
	}

	public boolean rowUpdated() throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
		//return false; // javac complains about not returning a value!
	}

	public void updateAsciiStream(int columnIndex,
								  java.io.InputStream x,
								  int length
								 ) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateBigDecimal(int columnIndex,
								 java.math.BigDecimal x
								) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateBinaryStream(int columnIndex,
								   java.io.InputStream x,
								   int length
								  ) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateBoolean(int columnIndex, boolean x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateByte(int columnIndex, byte x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateBytes(int columnIndex, byte[] x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateCharacterStream(int columnIndex,
									  java.io.Reader x,
									  int length
									 ) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateDate(int columnIndex, java.sql.Date x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateDouble(int columnIndex, double x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateFloat(int columnIndex, float x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateInt(int columnIndex, int x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateLong(int columnIndex, long x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateNull(int columnIndex) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateObject(int columnIndex, Object x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateObject(int columnIndex, Object x, int scale) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateRow() throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateShort(int columnIndex, short x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateString(int columnIndex, String x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateTime(int columnIndex, Time x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

	public void updateTimestamp(int columnIndex, Timestamp x) throws SQLException
	{
		// only sub-classes implement CONCUR_UPDATEABLE
		throw org.postgresql.Driver.notImplemented();
	}

}