Skip to content

Commit 603c46d

Browse files
author
Dave Cramer
committed
changes to accomodate updateable resultset mostly just call setSqlQuery on execute
1 parent 7873bed commit 603c46d

File tree

1 file changed

+112
-1
lines changed

1 file changed

+112
-1
lines changed

src/interfaces/jdbc/org/postgresql/jdbc2/Statement.java

Lines changed: 112 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,8 @@ public java.sql.ResultSet executeQuery(String sql) throws SQLException
7171
public int executeUpdate(String sql) throws SQLException
7272
{
7373
this.execute(sql);
74+
if (((org.postgresql.ResultSet)result).reallyResultSet())
75+
throw new PSQLException("postgresql.stat.result");
7476
return this.getUpdateCount();
7577
}
7678

@@ -124,12 +126,17 @@ public boolean execute(String sql) throws SQLException
124126
rs.close();
125127
}
126128

129+
127130
// New in 7.1, pass Statement so that ExecSQL can customise to it
128131
result = connection.ExecSQL(sql, this);
129132

130133
// New in 7.1, required for ResultSet.getStatement() to work
131134
((org.postgresql.jdbc2.ResultSet)result).setStatement(this);
132135

136+
// Added this so that the Updateable resultset knows the query that gave this
137+
((org.postgresql.jdbc2.ResultSet)result).setSQLQuery(sql);
138+
139+
133140
return (result != null && ((org.postgresql.ResultSet)result).reallyResultSet());
134141
}
135142

@@ -267,4 +274,108 @@ public void setResultSetType(int value) throws SQLException
267274
{
268275
resultsettype = value;
269276
}
270-
}
277+
278+
// In JDK 1.4 not implemented
279+
/**
280+
*
281+
* @param num
282+
* @return
283+
* @throws SQLException
284+
*/
285+
public boolean getMoreResults(int num) throws SQLException
286+
{
287+
throw org.postgresql.Driver.notImplemented();
288+
}
289+
290+
/**
291+
*
292+
* @return
293+
* @throws SQLException
294+
*/
295+
public java.sql.ResultSet getGeneratedKeys() throws SQLException
296+
{
297+
throw org.postgresql.Driver.notImplemented();
298+
}
299+
300+
/**
301+
*
302+
* @param a
303+
* @param b
304+
* @return
305+
* @throws SQLException
306+
*/
307+
public int executeUpdate(String a, int b) throws SQLException
308+
{
309+
throw org.postgresql.Driver.notImplemented();
310+
}
311+
312+
/**
313+
*
314+
* @param a
315+
* @param b
316+
* @return
317+
* @throws SQLException
318+
*/
319+
public int executeUpdate(String a, int[] b) throws SQLException
320+
{
321+
throw org.postgresql.Driver.notImplemented();
322+
323+
}
324+
325+
public int executeUpdate(String a, String[] b) throws SQLException
326+
{
327+
throw org.postgresql.Driver.notImplemented();
328+
329+
}
330+
331+
/**
332+
*
333+
* @param a
334+
* @param b
335+
* @return
336+
* @throws SQLException
337+
*/
338+
public boolean execute(String a, int b) throws SQLException
339+
{
340+
throw org.postgresql.Driver.notImplemented();
341+
342+
}
343+
344+
/**
345+
*
346+
* @param a
347+
* @param b
348+
* @return
349+
* @throws SQLException
350+
*/
351+
public boolean execute(String a, int[] b) throws SQLException
352+
{
353+
throw org.postgresql.Driver.notImplemented();
354+
355+
}
356+
357+
/**
358+
*
359+
* @param a
360+
* @param b
361+
* @return
362+
* @throws SQLException
363+
*/
364+
public boolean execute(String a, String[] b) throws SQLException
365+
{
366+
throw org.postgresql.Driver.notImplemented();
367+
368+
}
369+
370+
/**
371+
*
372+
* @return
373+
* @throws SQLException
374+
*/
375+
public int getResultSetHoldability() throws SQLException
376+
{
377+
throw org.postgresql.Driver.notImplemented();
378+
379+
}
380+
381+
}

0 commit comments

Comments
 (0)