Issue Details (XML | Word | Printable)

Key: DERBY-374
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Deepa Remesh
Reporter: A B
Votes: 0
Watchers: 0
Operations

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

Invalid URL with Derby Client when connecting to Network Server causes protocol exception.

Created: 19/Jun/05 04:01 PM   Updated: 24/May/06 04:26 AM
Return to search
Component/s: Network Client
Affects Version/s: 10.1.1.0, 10.2.1.6
Fix Version/s: 10.1.2.1, 10.2.1.6

Time Tracking:
Issue & Sub-Tasks
Issue Only
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works derby-374-patch.diff 2005-09-29 02:45 AM Deepa Remesh 12 kB
File Licensed for inclusion in ASF works derby-374-patch.status 2005-09-29 02:45 AM Deepa Remesh 0.5 kB
File Licensed for inclusion in ASF works derby374_test_changes.diff 2005-10-08 09:27 AM Deepa Remesh 3 kB
Environment: Network Server running with Derby client on Windows 2000.

Resolution Date: 12/Oct/05 04:29 AM

Sub-Tasks  All   Open   

 Description  « Hide
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).

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #292917 Sat Oct 01 04:30:43 UTC 2005 kmarsden DERBY-374

Invalid URL with Derby Client when connecting to Network Server causes protocol exception.

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

Contributed by Deepa Remesh
Files Changed
MODIFY /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnection.java
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/client/net/NetConnectionReply.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver.java
MODIFY /db/derby/code/trunk/java/drda/org/apache/derby/impl/drda/Database.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDriver.out

Repository Revision Date User Message
ASF #306942 Thu Oct 06 22:28:44 UTC 2005 kmarsden DERBY-374
Invalid URL with Derby Client when connecting to Network Server causes protocol exception.
merged from trunk with
svn merge -r 292916:292917 https://svn.apache.org/repos/asf/db/derby/code/trunk

Contributed by Deepa Remesh
Files Changed
MODIFY /db/derby/code/branches/10.1/java/drda/org/apache/derby/impl/drda/Database.java
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDriver.out
MODIFY /db/derby/code/branches/10.1/java/client/org/apache/derby/jdbc/ClientDriver.java
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver.java
MODIFY /db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/NetConnectionReply.java
MODIFY /db/derby/code/branches/10.1/java/drda/org/apache/derby/impl/drda/DRDAConnThread.java
MODIFY /db/derby/code/branches/10.1/java/client/org/apache/derby/client/net/NetConnection.java

Repository Revision Date User Message
ASF #307231 Sat Oct 08 01:31:35 UTC 2005 kmarsden DERBY-374

Disable some tests which are failing on unix until a cross platform solution
can be found
Contributed by Deepa Remesh
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDriver.out

Repository Revision Date User Message
ASF #307232 Sat Oct 08 01:40:13 UTC 2005 kmarsden DERBY-374

Disable some tests which are failing on unix until a cross platform solution
can be found
Contributed by Deepa Remesh
Files Changed
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDriver.out
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver.java