Uploaded image for project: 'MariaDB Connector/J'
  1. MariaDB Connector/J
  2. CONJ-62

NullPointerException when executeBatch is called, and batch list is empty

    XMLWordPrintable

Details

    • Bug
    • Status: Closed (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • 1.1.4
    • None
    • None

    Description

      This simple part of code demonstrates the NullPointerException in the current code of the MariaDB driver (v1.1.3):

      try {
      Class.forName("org.mariadb.jdbc.Driver");
      String dbUrl = "jdbc:mysql://host:3306/db";
      Connection con = DriverManager.getConnection(dbUrl, "user", "pwd");
      Statement stmt = con.createStatement();
      // do not add any batch entries!
      stmt.executeBatch(); // -> NullPointerException
      con.close();
      }
      catch(Exception ex) {
      ex.printStackTrace();
      }
       

      Result:
      java.lang.NullPointerException
      at org.mariadb.jdbc.MySQLStatement.executeBatch(MySQLStatement.java:1121)

      This NullPointerException is raised when the executeBatch is called with no batches added.

      Attachments

        Activity

          People

            wlad Vladislav Vaintroub
            wlad Vladislav Vaintroub
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Git Integration

                Error rendering 'com.xiplink.jira.git.jira_git_plugin:git-issue-webpanel'. Please contact your Jira administrators.