Derby
  1. Derby
  2. DERBY-2851

Corrections to client DataSource access example in the Server and administration guide

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 10.3.1.4
    • Component/s: Test
    • Labels:
      None

      Description

      http://db.apache.org/derby/docs/dev/adminguide/radminnsdatasourcexmp.html

      Shows an example for getting a connection through a DataSource by setting databaseName to "mydb;create=true". It should be changed to use "mydb" and use setCreateDatabase("create"). Also the comment that user/password are required is not correct.

      I think the getDS method can be removed and the example can just look like:

      org.apache.derby.jdbc.ClientDataSource ds =
      new org.apache.derby.jdbc.ClientDataSource();

      // DatabaseName can include Derby URL Attributes

      ds.setDatabaseName("mydb");
      ds.setCreateDatabase("create");
      ds.setUser("user");
      ds.setPassword("mypass");

      // The host on which Network Server is running
      ds.setServerName("localhost");

      // port on which Network Server is listening
      ds.setPortNumber(1527);

      Connection conn = ds.getConnection();

      1. derby2851_2.diff
        2 kB
        Laura Stewart
      2. derby2851.diff
        2 kB
        Laura Stewart
      3. radminnsdatasourcexmp.html
        3 kB
        Laura Stewart

        Activity

        Hide
        Laura Stewart added a comment -

        Attaching a patch for this issue and an html file to show the updates.

        Show
        Laura Stewart added a comment - Attaching a patch for this issue and an html file to show the updates.
        Hide
        Kathey Marsden added a comment -

        The only change I would say is to remove this line.
        // DatabaseName can include Derby URL Attributes

        Show
        Kathey Marsden added a comment - The only change I would say is to remove this line. // DatabaseName can include Derby URL Attributes
        Hide
        Laura Stewart added a comment -

        Attaching updated patch.

        Show
        Laura Stewart added a comment - Attaching updated patch.
        Hide
        Laura Stewart added a comment -

        On the main trunk - Committed revision 553588
        On the 10.3 branch - Committed revision 553592

        Show
        Laura Stewart added a comment - On the main trunk - Committed revision 553588 On the 10.3 branch - Committed revision 553592

          People

          • Assignee:
            Laura Stewart
            Reporter:
            Kathey Marsden
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development