Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-2160650 | 7 | Lance Andersen | P3 | Closed | Fixed | b01 |
When using default implementation of JdbcRowSetImpl(), calling execute() throws "Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'" error message, that cannot be caught. This is because it is being throws in JdbcRowSetImpl.java line 659. This either needs to be thrown as an exception or handled appropriately.
File : com/sun/rowset/JdbcRowSetImpl.java
Error: JdbcRowSet (setTypeMap): Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
Location:
652 protected PreparedStatement prepare() throws SQLException {
653 // get a connection
654 conn = connect();
655
656 try {
657 conn.setTypeMap(getTypeMap());
658 } catch (Throwable ex) {
659 System.err.println("JdbcRowSet (setTypeMap): " + <---
660 ex.getMessage()); <---
661 }
Reproducable Code Snippet:
--------------------------
try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
conn = DriverManager.getConnection(dbURL);
jrs = new JdbcRowSetImpl(conn);
jrs.setCommand("create table restaurants (id integer not null," +
"name varchar(25), city varchar(25))");
jrs.setConcurrency(ResultSet.CONCUR_UPDATABLE);
jrs.execute();
} catch (Exception except) {
except.printStackTrace();
}
File : com/sun/rowset/JdbcRowSetImpl.java
Error: JdbcRowSet (setTypeMap): Invalid value 'null' passed as parameter 'map' to method 'java.sql.Connection.setTypeMap'
Location:
652 protected PreparedStatement prepare() throws SQLException {
653 // get a connection
654 conn = connect();
655
656 try {
657 conn.setTypeMap(getTypeMap());
658 } catch (Throwable ex) {
659 System.err.println("JdbcRowSet (setTypeMap): " + <---
660 ex.getMessage()); <---
661 }
Reproducable Code Snippet:
--------------------------
try {
Class.forName("org.apache.derby.jdbc.EmbeddedDriver").newInstance();
conn = DriverManager.getConnection(dbURL);
jrs = new JdbcRowSetImpl(conn);
jrs.setCommand("create table restaurants (id integer not null," +
"name varchar(25), city varchar(25))");
jrs.setConcurrency(ResultSet.CONCUR_UPDATABLE);
jrs.execute();
} catch (Exception except) {
except.printStackTrace();
}
- backported by
-
JDK-2160650 Default JdbcRowSetImpl().execute() throws Invalid value 'null' passed as parameter 'map'
- Closed