db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Damien Corbishley" <Damien.Corbish...@uk.intervoice.com>
Subject Sybase Documentation
Date Thu, 26 Feb 2004 09:33:29 GMT
Hi,
 after reading this post about contributing to documentation, I thought
I'd offer this Sybase config for the database urls.
 I stupidly struggled for about an hour trying to connect to sybase.

The documentation always mentions mysql ( which is fine ) and shows
example properties as

  torque.database.createUrl = jdbc:mysql://127.0.0.1/mysql
 torque.database.buildUrl = jdbc:mysql://127.0.0.1/bookstore
 torque.database.url = jdbc:mysql://127.0.0.1/bookstore
 torque.database.driver = org.gjt.mm.mysql.Driver

So I tried just changing it to

  torque.database.createUrl = jdbc:sybase://127.0.0.1/mysql
  torque.database.buildUrl = jdbc:sybase://127.0.0.1/bookstore
  torque.database.url = jdbc:sybase://127.0.0.1/bookstore
  torque.database.driver = com.sybase.jdbc2.jdbc.SybDriver 

I can hear the groans already..

Which threw up some very weird errors, and after a bit I ended up with
this working config for Sybase ASE

  torque.database.createUrl =jdbc:sybase:Tds:127.0.0.1:4444/master
  torque.database.buildUrl = jdbc:sybase:Tds:127.0.0.1:4444/bookstore
  torque.database.url = jdbc:sybase:Tds:127.0.0.1:4444/bookstore
  torque.database.driver = com.sybase.jdbc2.jdbc.SybDriver

This is probably blindingly obvious to anyone with a sense of sybase
jdbc access, but maybe it could be put on the site as an example, if
just to save someone like myself an hour or so in the future.


Damien


>>> seade@backstagetech.com.au 12:57:07 25 February 2004 >>>
raph@mankin.org.uk wrote:

>As a newcomer to Torque, I would add that the lack of comprehensive
>documentation has been my biggest difficulty. Is there a documentation
project
>in hand? I think that such a project should even take precedece over
fixing
>bugs; if one at least has the wrinkles documented one can work around
them, and
>AFAICT most are not major.
>
Everyone is welcome to contribute documentation.  Send it to this list, 
the torque-dev list or add it to the wiki.

>
>To move on ... I encountered some unintuitive behaviour when doing an
update.
>
>
>I have a m:n join table. It looks something like
>
>        create table link (
>                PK integer auto_increment,      -- synthetic primary
key
>                parent integer references mastertable,
>                child  integer references mastertable
>        )
>
>Now, I wanted to move a child from one parent to a different parent
i.e. just
>update the 'parent' field in the link. I therefore selected on the
>(parent,child) pair, amended the parent value and called save(). This
is where
>things went wrong.
>
>Torque tried to save using the same criteria that it had used to
select, but I
>had changed one of the values. It therefore did an INSERT instead of an
UPDATE
>when what I wanted was that it should do an UPDATE using the primary
key.
>
>The actual behaviour is clearly the intended behaviour. What I am
questioning
>is whether this is the correct behaviour. As we know from recent 
postings,
>every table must have a primary key otherwise save() does not save.
Given that
>there always is a primary key, should all UPDATEs *always* use that key
and not
>the selection criteria?
>
>I worked around my problem, but good documentation would have made life
much
>easier.
>
Please post the relevant schema and code.

Scott

-- 
Scott Eade
Backstage Technologies Pty. Ltd.
http://www.backstagetech.com.au



---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message