Bug #6213 Connector/J Result.getConcurrency() doesn't return the right value
| Submitted: | 22 Oct 2004 12:34 | Modified: | 27 Oct 2004 8:16 |
|---|---|---|---|
| Reporter: | Christophe JOLIF | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | Connector / J | Severity: | S1 (Critical) |
| Version: | 3.0.15-ga | OS: | Windows (XP) |
| Assigned to: | CPU Architecture: | Any |
[26 Oct 2004 12:49]
Christophe JOLIF
Please close this bug, it seems I mistakely forgot to set a primary key on my table and so ResultSet objects are created instead of UpdatableResultSet objects (that have the right implementation for getConcurrency()). Sorry for the trouble.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.048 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: Even when building explicitely a CONCUR_UPDATABLE PreparatedStatement, ResultSet.getConcurrency() always return CONCUR_READONLY. What is strange is that looking at source code the value is rightly put in a private resultSetConcurrency field of the ResultSet but never used as a returned value of ResultSet.getConcurrency(). How to repeat: Connection c = DriverManager.getConnection("jdbc:mysql:///test"); PreparedStatement stmt = c.prepareStatement("select * from "+TABLE_NAME, ResultSet.TYPE_SCROLL_INSENSITIVE, ResultSet.CONCUR_UPDATABLE); ResultSet rs = stmt.executeQuery(); if (rs.getConcurrency() != ResultSet.CONCUR_UPDATABLE) System.err.println("err") System.out.println(rs.getType()+" "+rs.getConcurrency()); Suggested fix: public int getConcurrency() throws SQLException { return resultSetConcurrency; } on ResultSet.java