Description:
I'm using MySQL 4.0.15 with Connector/J 3.0.9 stable. I wrote a simple test java program to check if updatable result sets are correctly handled, with creating a CONCUR_UPDATABLE resultset on several tables: call prepareStatement("select * from TABLE", CONCUR_UPDATABLE) and display resultset.getConcurrency()...
However, on some of my tables, the resultset is not updtatable (I have a com.mysql.jdbc.NotUpdatable when i tried to update a row)
I'm suprised because:
1- it only affects some of my tables, but not all of them.
2- the problem vanished with an old version: Connector J 3.0.2 beta, but reappears with 3.0.3 and following versions.
Have you any suggestion ?
Thanks for help,
Arnaud.
How to repeat:
Here's the test case:
Properties namingProps = new Properties();
InitialContext ic = null;
// Init
namingProps.put(javax.naming.Context.PROVIDER_URL, "iiop://localhost:900");
namingProps.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory");
// Get DataSource
ic = new InitialContext(namingProps);
DataSource datasource = (DataSource) ic.lookup("jdbc/STDDataSource");
// SQL
Connection jdbc = datasource.getConnection();
PreparedStatement ps = jdbc.prepareStatement("SELECT * FROM MENU", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
ResultSet rs = ps.executeQuery();
System.out.println("" + rs.getConcurrency());
Description: I'm using MySQL 4.0.15 with Connector/J 3.0.9 stable. I wrote a simple test java program to check if updatable result sets are correctly handled, with creating a CONCUR_UPDATABLE resultset on several tables: call prepareStatement("select * from TABLE", CONCUR_UPDATABLE) and display resultset.getConcurrency()... However, on some of my tables, the resultset is not updtatable (I have a com.mysql.jdbc.NotUpdatable when i tried to update a row) I'm suprised because: 1- it only affects some of my tables, but not all of them. 2- the problem vanished with an old version: Connector J 3.0.2 beta, but reappears with 3.0.3 and following versions. Have you any suggestion ? Thanks for help, Arnaud. How to repeat: Here's the test case: Properties namingProps = new Properties(); InitialContext ic = null; // Init namingProps.put(javax.naming.Context.PROVIDER_URL, "iiop://localhost:900"); namingProps.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.ibm.websphere.naming.WsnInitialContextFactory"); // Get DataSource ic = new InitialContext(namingProps); DataSource datasource = (DataSource) ic.lookup("jdbc/STDDataSource"); // SQL Connection jdbc = datasource.getConnection(); PreparedStatement ps = jdbc.prepareStatement("SELECT * FROM MENU", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE); ResultSet rs = ps.executeQuery(); System.out.println("" + rs.getConcurrency());