Issue Details (XML | Word | Printable)

Key: DERBY-530
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Kathey Marsden
Reporter: Piet Blok
Votes: 0
Watchers: 1
Operations

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

ClientDriver ignores Properties object in connect(String url, Properties connectionProperties) method

Created: 24/Aug/05 12:25 AM   Updated: 20/Mar/07 09:54 PM
Return to search
Component/s: Network Client
Affects Version/s: 10.1.1.0
Fix Version/s: 10.1.2.1, 10.2.1.6

Time Tracking:
Not Specified

File Attachments:
  Size
File Licensed for inclusion in ASF works DERBY530.diff 2005-09-10 05:03 AM Kathey Marsden 32 kB
Environment: windows XP, JRE 1.5.0_04
Issue Links:
Dependants
 

Resolution Date: 17/Sep/05 08:07 AM


 Description  « Hide
In contrast to EmbeddedDriver, a connection attribute create=true is not recognized when presented as a property in a Properties object.

 As a workaround I append the attributes from the Properties object to the url string before invoking the connect() method: then a new database is created and a connection is established.

Next code fragment illustrates the bug and the workaround:



    private static final ClientDriver clientDriver = new ClientDriver();


    private Connection getClientConnection(String database,
            Properties connectionProperties) throws SQLException {
        try {
            System.out.println("Try to connect with properties");
            String connectionURL = "jdbc:derby://127.0.0.1:1527/" + database;
            System.out.println("connectionURL: " + connectionURL);
            Connection rv = clientDriver.connect(connectionURL,
                    connectionProperties);
            System.out.println("Connection: " + rv);
            return rv;
        } catch (SQLException e) {
            System.out.println("Try to connect with URL attributes");
            StringBuffer sb = new StringBuffer();
            for (Enumeration enu = connectionProperties.propertyNames(); enu
                    .hasMoreElements();) {
                String key = (String) enu.nextElement();
                sb.append(';');
                sb.append(key);
                sb.append('=');
                sb.append(connectionProperties.getProperty(key, ""));
            }
            String connectionURL = "jdbc:derby://127.0.0.1:1527/" + database
                    + sb.toString();
            System.out.println("connectionURL: " + connectionURL);
            Connection rv = clientDriver.connect(connectionURL,
                    connectionProperties);
            System.out.println("Connection: " + rv);
            System.out
                    .println("!!!!!!!!!!! seems a bug: Properties argument in ClientDriver.connect(String, Properties) has not been used");
            return rv;
        }
    }



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Repository Revision Date User Message
ASF #279860 Fri Sep 09 19:50:58 UTC 2005 kmarsden DERBY-561 - Embedded driver jdbcCompliant() method should return true
Test will be checked in as part of tess for DERBY-530
Files Changed
MODIFY /db/derby/code/trunk/java/engine/org/apache/derby/jdbc/InternalDriver.java

Repository Revision Date User Message
ASF #289227 Thu Sep 15 12:49:14 UTC 2005 kmarsden DERBY-530
ClientDriver ignores Properties object in connect(String url, Properties connectionProperties) method

Send both the properties specified in the info parameter and those specified in the url to the server in the RDBNAM. user and password attributes will be the exception. user and password will be sent via the standard DRDA mechanism and excluded from the attributes sent with RDBNAM whether specified with the url or info properties. As a result of the combination, the order of attributes sent to the server may be different than originally specified in the URL.

Also added additional driver tests and attrbute tests to checkDriver.
Files Changed
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/checkDriver.out
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/checkDriver.out
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver_derby.properties
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users.out
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users2.out
MODIFY /db/derby/code/trunk/java/client/org/apache/derby/jdbc/ClientDriver.java
MODIFY /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver_app.properties
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/tests/jdbcapi/copyfiles.ant
ADD /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDriver.out

Repository Revision Date User Message
ASF #289672 Fri Sep 16 22:59:43 UTC 2005 kmarsden DERBY-530

ClientDriver ignores Properties object in connect(String url, Properties connectionProperties) method
Merge from trunk
svn merge -r289226:289227 https://svn.apache.org/repos/asf/db/derby/code/trunk
Files Changed
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/copyfiles.ant
ADD /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver_derby.properties (from /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver_derby.properties)
ADD /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDriver.out (from /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/checkDriver.out)
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/secureUsers.out
ADD /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/checkDriver.out (from /db/derby/code/trunk/java/testing/org/apache/derbyTesting/functionTests/master/DerbyNet/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/master/DerbyNetClient/users2.out
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/checkDriver_app.properties
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/testing/org/apache/derbyTesting/functionTests/master/DerbyNetClient/users.out
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
MODIFY /db/derby/code/branches/10.1/java/testing/org/apache/derbyTesting/functionTests/master/checkDriver.out

Repository Revision Date User Message
ASF #289989 Sun Sep 18 22:27:48 UTC 2005 kmarsden DERBY-530

Addtional test checkin to fix output on non-windows platforms
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 #290316 Tue Sep 20 00:00:57 UTC 2005 kmarsden DERBY-530

Merge from trunk (289989) Addtional test checkin to fix output on non-windows platforms
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