RE: HSQLDB standalone in webapp?

From: Gentry, Michael (michael_gentr..anniemae.com)
Date: Tue Oct 26 2004 - 10:56:13 EDT

  • Next message: Kevin J. Menard, Jr.: "Re: HSQLDB standalone in webapp?"

    Look at HSQLDB_HOME/src/hsqldb/test/TestBase.java to see an example of
    how to start the server up. The server properties are what I was going
    to put in the <property> tags in the Tapestry .application file (you'd
    have to edit this file to specify your database location, though).
    You'd read the property setting from the .application file and then feed
    it to your Server instance.

    Your URL to connect to your database would then use the "hsql" method
    instead of the "file" method. I think your connection dictionary in
    Cayenne would probably stay static, now that I'm thinking about it some.
    And, as long as your application is running, you have a database server
    running, too, which is accessible using external tools. I haven't tried
    seeing if I could access a database using the "file" method, though (for
    example, like when the application isn't running -- as might be the case
    when developing).

    /dev/mrg

    -----Original Message-----
    From: Kevin J. Menard, Jr. [mailto:nirvdru..egativetwenty.net]
    Sent: Tuesday, October 26, 2004 10:38 AM
    To: Gentry, Michael
    Cc: cayenne-use..bjectstyle.org
    Subject: Re: HSQLDB standalone in webapp?

    On Oct 26, 2004, at 10:18 AM, Gentry, Michael wrote:

    > Would you believe I was just looking into that over the weekend?
    > Substitute Tomcat for Jetty, though.

    Well, I'm glad then. You got to do all the dirty work :-) Well, I did
    spend a fair amount of time on it, I just don't have much to show for
    it.

    >
    > The solution I initially came up with -- and their might be a better
    > way
    > -- is to add some <property> tags in the .application file to specify
    > the path/etc (basically, any custom configuration key/value pairs).
    > Then you can read the property and set the connection dictionary/etc.

    Hmm . . . I guess this is the part I could use some pointers on. How
    do you do this programmatically? I thought the complication would be
    the specification of the db path in the jdbc url in the datanode file.
    But if that can be set at run time, then I guess it isn't that big of
    an issue.

    >
    > I was going to post the Tapestry-specific code bits to the
    > tapestry-user
    > mailing list, but I can include it here, too, if anyone else is
    > interested. I haven't gotten to the point yet of setting the
    > connection
    > dictionary, but that's pretty easy once you have the values.

    I'm on both lists, so I'll get it either way. It might be interesting
    for others though.

    >
    > /dev/mrg
    >
    > PS. I'm also leaning towards running HSQLDB in server mode from within
    > the Tapestry application, so I can still access it (the database)
    while
    > the application is running. Just a thought for you.

    Are you looking to run a dedicated server, or using the HSQLDB servlet?
      Being able to connect with other processes would be nice, but I was
    looking for the "easiest" path.

    Thanks,
    Kevin



    This archive was generated by hypermail 2.0.0 : Tue Oct 26 2004 - 10:56:18 EDT