Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-6492619

Default JdbcRowSetImpl().execute() throws Invalid value 'null' passed as parameter 'map'

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 6u1
    • 6
    • core-libs
    • None
    • b01
    • generic
    • generic
    • Verified

        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();
                }

              lancea Lance Andersen
              skonchad Sandeep Konchady
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved:
                Imported:
                Indexed: