Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-736

"" does not work as a userid for Derby client (SqlException: userid length, 0, is not allowed.)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 10.1.2.1, 10.1.3.1, 10.2.1.6
    • Fix Version/s: 10.1.3.1, 10.2.1.6
    • Component/s: Network Client
    • Labels:
      None

      Description

      $ java TestConnect
      Derby embedded allows "" as a user id. DerbyClient however,
      throws the following exception:

      connected with embedded
      Exception in thread "main" org.apache.derby.client.am.SqlException: userid length, 0, is not allowed.
      at org.apache.derby.client.net.NetConnection.checkUserLength(NetConnection.java:993)
      at org.apache.derby.client.net.NetConnection.checkUser(NetConnection.java:1008)
      at org.apache.derby.client.net.NetConnection.checkUserPassword(NetConnection.java:1012)
      at org.apache.derby.client.net.NetConnection.flowConnect(NetConnection.java:384)
      at org.apache.derby.client.net.NetConnection.<init>(NetConnection.java:195)
      at org.apache.derby.jdbc.ClientDriver.connect(ClientDriver.java:125)
      at java.sql.DriverManager.getConnection(DriverManager.java:512)
      at java.sql.DriverManager.getConnection(DriverManager.java:171)
      at TestConnect.main(TestConnect.java:23)
      $

      Below is the program to reproduce

      import java.sql.DriverManager;
      import java.sql.Connection;
      import java.sql.*;

      public class TestConnect
      {
      public static void main(String argv[])
      throws Exception

      { Connection con = null; String user = ""; String pwd = ""; // Embedded is ok Class.forName("org.apache.derby.jdbc.EmbeddedDriver"); con = DriverManager.getConnection("jdbc:derby:" + "dbemb;create=true", user, pwd); System.out.println("connected with embedded" ); // Will not connect with zero length user id with client Class.forName("org.apache.derby.jdbc.ClientDriver"); con = DriverManager.getConnection("jdbc:derby://localhost:1527/" + "dbnet;create=true", user, pwd); System.out.println("connected with client" ); con.close(); System.out.println("closed"); }

      }

        Attachments

          Activity

            People

            • Assignee:
              kmarsden Katherine Marsden
              Reporter:
              kmarsden Katherine Marsden
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: