Connecting to keel's hsqldb?

"Calvin Smith" <[email protected]>
Newsgroups gmane.comp.java.keel.user
Message-ID <[email protected]>
Hi,

I'm just getting started with Keel, so forgive me if there are any silly
mistakes in what follows. I'm on my way to getting persistance working
with hsqldb and hibernate services, but I've run into a couple of
problems.

First, I would like to see what hsql has in the database, and have been
trying to connect to the hsqldb that is running inside keel, but I can't
get the connect string, user, and password correct. I've tried various
ports and URLs for the two standard hsql URLs (jdbc:hsqldb:<database>
and jdbc:hsqldb:hsql://<host>:<port>, including port 9001, which I think
is the standard port, but I always get a "Connection refused" error. Can
anybody tell me what the default database url is for hsqldb in keel, or
which file this would be configured in?

Second, and this is the underlying problem I'm having with hsql and
hibernate, it seems that I am able to add objects created from
information a user submitted, but when I retrieve an object later, it
always seems to return the same object, regardless of what I've set the
field to for the retrieve. 

I'm adding like so:

Persistent m = pf.create("tax.ZipTaxRate"); m.setField("newZipCode",
request.getParameter("newZipCode"));
m.setField("newTaxRate", request.getParameter("newTaxRate"));
m.add();

And this works with no errors. For the sake of the example, let's say I
did this twice, with different zip codes and tax rates each time.

The problem is that when I later try to retrieve an object, it always
retrieves the first object added, even when the field for the retrieve
(newZipCode, which is the key) has been set to the zip code of the
second object.

Here is how I'm trying to retrieve the object:

Persistent m = pf.create("tax.ZipTaxRate"); String zipCode = (String)
request.getParameter("zipCode"); m.setField("newZipCode", zipCode); //
zipCode is the value of the second object I added
m.retrieve();			
ZipRate zipRate = (ZipRate) m.getBean(); // simple bean with two fields,
newZipCode & newTaxRate

When I do zipRate.getNewTaxRate(), I get the value for the first object,
not the object that has the key I submitted. Maybe I'm doing something
wrong here, or perhaps I'm running into some kind of cache issue. Does
this problem ring a bell for anybody?

cheers,

Calvin 

-- 

ThatOne Company

http://www.thatone.com/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.