You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by Liam McAllister <st...@hotmail.com> on 2003/04/15 21:01:48 UTC
Turbine with Sybase Stored Procedures only?
Hi
I am a software developer who has been looking at Turbine for possible using it for a Java WEB application, with a backend Sybase Database which uses Sybase Stored Procedures (only) to add/delete/update data to the database. These have already been created - we cannot modify them.
I have read through the tutorials and the Auto Java class generation looks great - but there are a few things I haven't been able to find out, which would be crux to whether we do the development using Turbine:
The database has already been created (by a 3rd party), and we only talk to the DB using Stored Procedures I didn't see anywhere in tutorials of how you would generate The Java source files for stored procs using Turbine - Is Turbine suitable with Stored Procedures?
If it is suitable for use with Stored Procs, as we already have these created - is there anyway to get Turbine to auto-generate the java sources from these or do I still have to manually create the xml-schema file? (how does this match up to a Stored Proc?)
In a NPE/Tomcat environment - am I right in Thinking Turbine will handle all the Database pooling issues?
Thanks in advance for any help/pointers/directions you are able to give - pls reply by mail is possible!!!!
Thanks
Liam.
Re: Turbine with Sybase Stored Procedures only?
Posted by Otto Cordero <oc...@sipecom.com>.
Liam,
I am using Turbine and Sybase with store procedures, I am not using Torque,
instead I wrote my own db layer using DBCP to pool connections. I though
some ideas that we use in our system might help you.
In our system, the name of the store procedures are stored in a
configuration file. For us, this file is a java properties file. So you can
call the required store procedure with something like
connection.prepareCall("exec "+TurbineResources.getString(EMPLOYEES));
EMPLOYEES being a constant for the keyvalue that refer to the sp name in the
props file.
The biggest problem you will find is how to manage the parameters, since in
the jdbc api store procs are treated like prepared statements; this means
that you will set the parameters with something like stmt.set(1, param); so
you have to know the correct order of the parameters. This is difficult to
specify in a configuration file, or even to remember while you are coding
since store procs may have many parameters. We do this with properties, but
I wouldn't recommend it. I think you could build an object that manages a
XML configuration file with the sp's names and parameters.
To be more explicit, you could have somthing like this:
<storeprocedure name="sp_yoursp">
<param name="xx" type="int" />
<param name="yy" type="str" />
</storeprocedure>
The purpose of this is to help you encapsulate the calls to store procedures
in a single class. This is a big help if your system is not small.
Let me know if this ideas or something related works for you. We could join
efforts,
Hope this helps, Cheers,
Otto.
PS: As Quinton said, Turbine has little to do on how you acces the
datasource, so in any case you will probably have to write your own db
layer.
----- Original Message -----
From: "Liam McAllister" <st...@hotmail.com>
To: <tu...@jakarta.apache.org>
Sent: Tuesday, April 15, 2003 2:01 PM
Subject: Turbine with Sybase Stored Procedures only?
Hi
I am a software developer who has been looking at Turbine for possible using
it for a Java WEB application, with a backend Sybase Database which uses
Sybase Stored Procedures (only) to add/delete/update data to the database.
These have already been created - we cannot modify them.
I have read through the tutorials and the Auto Java class generation looks
great - but there are a few things I haven't been able to find out, which
would be crux to whether we do the development using Turbine:
The database has already been created (by a 3rd party), and we only talk to
the DB using Stored Procedures I didn't see anywhere in tutorials of how you
would generate The Java source files for stored procs using Turbine - Is
Turbine suitable with Stored Procedures?
If it is suitable for use with Stored Procs, as we already have these
created - is there anyway to get Turbine to auto-generate the java sources
from these or do I still have to manually create the xml-schema file? (how
does this match up to a Stored Proc?)
In a NPE/Tomcat environment - am I right in Thinking Turbine will handle all
the Database pooling issues?
Thanks in advance for any help/pointers/directions you are able to give -
pls reply by mail is possible!!!!
Thanks
Liam.
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org
RE: Turbine with Sybase Stored Procedures only?
Posted by Quinton McCombs <qm...@nequalsone.com>.
> -----Original Message-----
> From: Liam McAllister [mailto:stay_athome@hotmail.com]
> Sent: Tuesday, April 15, 2003 2:02 PM
> To: turbine-user@jakarta.apache.org
> Subject: Turbine with Sybase Stored Procedures only?
>
>
> Hi
>
> I am a software developer who has been looking at Turbine for
> possible using it for a Java WEB application, with a backend
> Sybase Database which uses Sybase Stored Procedures (only) to
> add/delete/update data to the database. These have already
> been created - we cannot modify them.
>
> I have read through the tutorials and the Auto Java class
> generation looks great - but there are a few things I haven't
> been able to find out, which would be crux to whether we do
> the development using Turbine:
>
> The database has already been created (by a 3rd party), and
> we only talk to the DB using Stored Procedures I didn't see
> anywhere in tutorials of how you would generate The Java
> source files for stored procs using Turbine - Is Turbine
> suitable with Stored Procedures?
Turbine doesn't care how you access the database. That is the job of
Torque or some other persistence framework.
Torque might not be the bext choice for your project. All of the code
it generates is for accessing the database tables directly. In your
case, this will not help you at all.
You can still use Turbine and write your own database layer using JDBC.
You might also be able to use another persistence layer to reduce the
amount of code you have to write to access the database.
> If it is suitable for use with Stored Procs, as we already
> have these created - is there anyway to get Turbine to
> auto-generate the java sources from these or do I still have
> to manually create the xml-schema file? (how does this match
> up to a Stored Proc?)
It does not match up at all.
> In a NPE/Tomcat environment - am I right in Thinking Turbine
> will handle all the Database pooling issues?
Turbine will not handle this for you. That is part of Torque. If you
don't use Torque, you can use the DBCP project in jakarta commons. It
is a library that is specifically written to pool database connections.
Torque uses it as well.
> Thanks in advance for any help/pointers/directions you are
> able to give - pls reply by mail is possible!!!!
>
> Thanks
>
> Liam.
>
---------------------------------------------------------------------
To unsubscribe, e-mail: turbine-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: turbine-user-help@jakarta.apache.org