Re: [OS-JIRA] Created: (CAY-183) Adapter for Clouscape/Derby DB

From: Tore Halset (halse..vv.ntnu.no)
Date: Tue May 10 2005 - 10:07:57 EDT

  • Next message: Gentry, Michael \(Contractor\): "RE: Cayenne 1.1: User Guide - Using Expressions - TYPO"

    On May 4, 2005, at 5:07, Andrus Adamchik wrote:

    > Just checked in Derby DbAdapter contributed by Tore Halset (see
    > CAY-183). I made a few minor tweaks to make it run on Mac OS X (had
    > to add System.setProperty("derby.storage.fileSyncTransactionLog",
    > "true") to the DerbyStackAdapter) ...
    >
    > Here is the settings I used in connection.properties (note the
    > database name is "testrun/testdb" to force its creation in the unit
    > tests temp dir, and preventing it from appearing in the root
    > project tree):
    >
    > derby.cayenne.adapter = org.objectstyle.cayenne.dba.derby.DerbyAdapter
    > derby.jdbc.url = jdbc:derby:testrun/testdb;create=true
    > derby.jdbc.driver = org.apache.derby.jdbc.EmbeddedDriver
    >
    > I got stuck when attempting to test Derby in the client/server mode
    > (can't connect from JDBC and get some driver errors in "ij" tool),
    > but I guess I simply need to read the manual.

    Here are the connection.properties-record for using derby in client/
    server mode:
    derby.cayenne.adapter = org.objectstyle.cayenne.dba.derby.DerbyAdapter
    derby.jdbc.url = jdbc:derby://localhost:1527/testdb;create=true
    derby.jdbc.driver = org.apache.derby.jdbc.ClientDriver
    (perhaps this should be added to the adapters javadoc?)

    Extra info on the ClientDriver:
    http://incubator.apache.org/derby/papers/DerbyClientSpec.html

    The application uses derbyclient.jar and the server uses derby.net
    and derbynet.jar in its classpath.

    This is how you can start the server:
    java -cp derbynet.jar:derby.jar
    org.apache.derby.drda.NetworkServerControl start -h localhost -p 1527

    This is how you can stop the server:
    java -cp derbynet.jar:derby.jar
    org.apache.derby.drda.NetworkServerControl shutdown -h localhost -p 1527

    This is how you can connect using ij:
    java -cp derbyclient.jar:derbytools.jar org.apache.derby.tools.ij
    ij> driver 'org.apache.derby.jdbc.ClientDriver';
    ij> connect 'jdbc:derby://localhost:1527/testdb;create=true';

    Using this setup, it passes all of the unit-tests.

    Regards,
      - Tore.



    This archive was generated by hypermail 2.0.0 : Tue May 10 2005 - 10:08:02 EDT