Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 57554 invoked from network); 28 Sep 2005 17:48:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 28 Sep 2005 17:48:13 -0000 Received: (qmail 73115 invoked by uid 500); 28 Sep 2005 17:48:11 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 73061 invoked by uid 500); 28 Sep 2005 17:48:11 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 73045 invoked by uid 99); 28 Sep 2005 17:48:11 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=SPF_FAIL X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 28 Sep 2005 10:48:09 -0700 Received: from ajax.apache.org (ajax.apache.org [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id A8D46123 for ; Wed, 28 Sep 2005 19:47:48 +0200 (CEST) Message-ID: <750345474.1127929668689.JavaMail.jira@ajax.apache.org> Date: Wed, 28 Sep 2005 19:47:48 +0200 (CEST) From: "Deepa Remesh (JIRA)" To: derby-dev@db.apache.org Subject: [jira] Updated: (DERBY-374) Invalid URL with Derby Client when connecting to Network Server causes protocol exception. In-Reply-To: <958913815.1119164537157.JavaMail.jira@ajax.apache.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ http://issues.apache.org/jira/browse/DERBY-374?page=all ] Deepa Remesh updated DERBY-374: ------------------------------- Attachment: derby-374-patch.diff derby-374-patch.status Attaching a patch derby-374-patch.diff for network server and client to handle invalid URLs. This patch does the following: 1. Network server used to give NPE when InternalDriver returns null connection for certain malformed URLs. With this patch, network server checks for null connections returned by InternalDriver and returns RDBAFLRM and SQLCARD with null SQLException. I spoke to Kathey about how to pass null SQLCARDs. 2. The client parses the SQLCARD and if finds null SQLException, it sets connectionNull variable in NetConnection to true. 3. ClientDriver connect method, which calls the constructor of NetConnection, gets back an object with connectionNull set to true. And it inturn returns null connection. 4. Added tests to checkDriver.java for more Client URLs. Army, This patch handles the URLs you mentioned. Does this look okay to you? > Invalid URL with Derby Client when connecting to Network Server causes protocol exception. > ------------------------------------------------------------------------------------------ > > Key: DERBY-374 > URL: http://issues.apache.org/jira/browse/DERBY-374 > Project: Derby > Type: Bug > Components: Network Client > Versions: 10.2.0.0, 10.1.1.0 > Environment: Network Server running with Derby client on Windows 2000. > Reporter: A B > Assignee: Deepa Remesh > Fix For: 10.2.0.0 > Attachments: derby-374-patch.diff, derby-374-patch.status > > If using the Derby Client to connect to the Derby Network Server, there are some cases where an invalid URL will cause a protocol exception instead of throwing a proper error. The two cases I've found are as follow: > 1) Use of a colon to separate attributes: > When connecting to the server with JCC, a colon is required to demarcate the Derby attributes from the JCC attributes. For the Derby Client, however, the colon is not a valid part of the URL, so use of it should return an error. However, the result is a protocol exception: > ij> connect 'jdbc:derby://localhost:1528/sample:user=someUsr;password=somePwd'; > agentThread[DRDAConnThread_9,5,main] > ERROR (no SQLState): A communication error has been detected. Communication protocol being used: Reply.fill(). Communication API being used: InputStream.read(). Location where the error was detected: > insufficient data. Communication function detecting the error: *. Protocol specific error codes(s) TCP/IP SOCKETS > 2) Use of double-quotes to specify a full path to a database. > The use of double-quotes around a database path is required when connecting to the server with JCC, but should be optional when using the Derby Client. However, attempts to use the double-quotes doesn't work--on the contrary, it throws a protocol exception: > ij> connect 'jdbc:derby://localhost:1528/"C:/myDBs/sample"'; > agentThread[DRDAConnThread_11,5,main] > ERROR (no SQLState): A communication error has been detected. Communication protocol being used: Reply.fill(). Communication API being used: InputStream.read(). Location where the error was detected: > insufficient data. Communication function detecting the error: *. Protocol specific error codes(s) TCP/IP SOCKETS > Without quotes, the above example will work as expected. > I'm not sure if the problem is with the Derby client or the Network Server (more investigation required). -- 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