db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kathey Marsden (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-736) "" does not work as a userid for Derby client (SqlException: userid length, 0, is not allowed.)
Date Thu, 01 Dec 2005 03:16:31 GMT
    [ http://issues.apache.org/jira/browse/DERBY-736?page=comments#action_12358993 ] 

Kathey Marsden commented on DERBY-736:
--------------------------------------

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 "".



> ""  does not work as a userid for Derby client (SqlException: userid length, 0, is not
allowed.)
> ------------------------------------------------------------------------------------------------
>
>          Key: DERBY-736
>          URL: http://issues.apache.org/jira/browse/DERBY-736
>      Project: Derby
>         Type: Bug
>   Components: Network Client
>     Versions: 10.1.2.1, 10.2.0.0, 10.1.3.0, 10.1.2.2
>     Reporter: Kathey Marsden
>      Fix For: 10.2.0.0, 10.1.3.0, 10.1.2.2

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

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message