Issue Details (XML | Word | Printable)

Key: DERBY-736
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Major Major
Assignee: Kathey Marsden
Reporter: Kathey Marsden
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Derby

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

Created: 01/Dec/05 08:51 AM   Updated: 25/Apr/06 03:49 AM
Return to search
Component/s: Network Client
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

Time Tracking:
Not Specified

Resolution Date: 25/Apr/06 03:49 AM


 Description  « Hide
$ 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");
}

}

 



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Satheesh Bandaram added a comment - 01/Dec/05 10:28 AM
Do we really want to allow this? How would authentication work, if enabled? What is the default schema for this "" user?

Kathey Marsden added a comment - 01/Dec/05 12:15 PM
This was an issue from a user who said that this was working on embedded but not for client. If enabled for client, the userid would be passed as is to the embedded driver and be handled like it is in the embedded driver.

I am not sure how embedded handles the default schema and authentication for the user "".


Kathey Marsden added a comment - 06/Jan/06 10:16 AM
Network Client cannot be match embedded in this regard as the DRDA spec specifies that USRID has a MINLEN of 1

Andrew McIntyre added a comment - 25/Apr/06 03:35 AM
Reopening to set Fix In to 10.1.3 also.