You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@turbine.apache.org by Humberto Hernandez Torres <hh...@itweb.com.mx> on 2002/03/22 18:50:22 UTC

Driver dependencies in Torque 3.0

I was trying to make Scarab run with MS SQL but my driver JDBC wasn´t being
recognized. After looking around for a while and downloading the CVS sources
for torque-3.0. I found that in org.apache.torque.adapter.DBFactory there is
a map with the databases and the available drivers. This mapping didn´t seem
to be there in the  previous versions and I don´t think it should be
hardcoded since it makes you loose the flexibility to use your favorite JDBC
driver.

¿What is the purpose of the new version? ¿Shouldn't we go back to the
previous configurable adapters?

This used to work in TurbineResources.properties:
services.DatabaseServices.database.adaptor=DBMSSQL
services.DatabaseServices.database.DBMSQL=com.jnetdirect.jsql.JSQLDriver

-- 
 Humberto

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Driver dependencies in Torque 3.0

Posted by Daniel Rall <dl...@finemaltcoding.com>.
John McNally <jm...@collab.net> writes:

> Similar to the old way, but there will be no tie between the adapter
> and the driver (if a driver is even used.)

So the adapter will be coupled to the database, rather than any
specific driver for that database?  If so, +1.  If not, please
elaborate.

- Dan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Driver dependencies in Torque 3.0

Posted by Daniel Rall <dl...@finemaltcoding.com>.
Jason van Zyl <jv...@zenplex.com> writes:

> On Sat, 2002-03-23 at 14:18, John McNally wrote:
> > Something like the following:
>> 
>>         Configuration c =
>> configuration.subset("database").subset("adapter");
>>         Iterator i = c.getKeys();
>>         while (i.hasNext())
>>         {
>>             String key = (String)i.next();                
>>             String adapter = c.getString(key);
>>             DB db = DBFactory.create( adapter );
>>             // register the adapter for this name
>>             adapterMap.put(key, db);
>>         }
>> 
>> This code does not care, if the Configuration is reading a properties
>> file or an xml file.
>
> That may be true but, in the form of a properties you can't validate it,
> and making tools to help with configuration is a severe PITA. People can
> use them but I would strongly encourage the use of XML configuration
> files because errors can be spotted immediately and if people are making
> new configuration files then they can be assured they are being made
> correctly. We have partial config info in XML and in properties and I
> think we should settle on one format and I definitely don't think it
> should be properties files.

So we can encourage the XML interface, but I am also in favor of
allowing the classic properties file interface through the
Configuration interface.

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Driver dependencies in Torque 3.0

Posted by Jason van Zyl <jv...@zenplex.com>.
On Sat, 2002-03-23 at 14:18, John McNally wrote:
> Something like the following:
> 
>         Configuration c =
> configuration.subset("database").subset("adapter");
>         Iterator i = c.getKeys();
>         while (i.hasNext())
>         {
>             String key = (String)i.next();                
>             String adapter = c.getString(key);
>             DB db = DBFactory.create( adapter );
>             // register the adapter for this name
>             adapterMap.put(key, db);
>         }
> 
> This code does not care, if the Configuration is reading a properties
> file or an xml file.

That may be true but, in the form of a properties you can't validate it,
and making tools to help with configuration is a severe PITA. People can
use them but I would strongly encourage the use of XML configuration
files because errors can be spotted immediately and if people are making
new configuration files then they can be assured they are being made
correctly. We have partial config info in XML and in properties and I
think we should settle on one format and I definitely don't think it
should be properties files.
 
> john mcnally
> 
> 
> 
> Jason van Zyl wrote:
> > 
> > On Sat, 2002-03-23 at 00:08, John McNally wrote:
> > > Jason van Zyl wrote:
> > > >
> > > > On Fri, 2002-03-22 at 18:57, John McNally wrote:
> > > > > Please send a patch to get your driver included in DBFactory.  There is
> > > > > not much reason to recode to the old style.  Soon torque will use any
> > > > > connection pool and the adapter will be specified in the properties
> > > > > file.  Similar to the old way, but there will be no tie between the
> > > > > adapter and the driver (if a driver is even used.)
> > > >
> > > > Can we please use an XML configuration if we're going to change
> > > > anything. I think XML configurations lend themselves to manipulation in
> > > > an UI much more easily and they can be verified with an XML Scheme or
> > > > XML DTD.
> > > >
> > >
> > > I thought the point of switching to the Configuration interface was to
> > > allow the xml option.  There is no reason this needs to be different
> > > than the other parameters.
> > 
> > I'm not sure I understand the argument here. Are you saying you want to
> > use a properties file? And why bother with XML? I'm just making sure I
> > understand before I respond.
> > 
> > > john mcnally
> > >
> > > --
> > > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > > For additional commands, e-mail: <ma...@jakarta.apache.org>
> > --
> > jvz.
> > 
> > Jason van Zyl
> > jvanzyl@apache.org
> > 
> > http://tambora.zenplex.org
> > 
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://tambora.zenplex.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Driver dependencies in Torque 3.0

Posted by John McNally <jm...@collab.net>.
Something like the following:

        Configuration c =
configuration.subset("database").subset("adapter");
        Iterator i = c.getKeys();
        while (i.hasNext())
        {
            String key = (String)i.next();                
            String adapter = c.getString(key);
            DB db = DBFactory.create( adapter );
            // register the adapter for this name
            adapterMap.put(key, db);
        }

This code does not care, if the Configuration is reading a properties
file or an xml file.

john mcnally



Jason van Zyl wrote:
> 
> On Sat, 2002-03-23 at 00:08, John McNally wrote:
> > Jason van Zyl wrote:
> > >
> > > On Fri, 2002-03-22 at 18:57, John McNally wrote:
> > > > Please send a patch to get your driver included in DBFactory.  There is
> > > > not much reason to recode to the old style.  Soon torque will use any
> > > > connection pool and the adapter will be specified in the properties
> > > > file.  Similar to the old way, but there will be no tie between the
> > > > adapter and the driver (if a driver is even used.)
> > >
> > > Can we please use an XML configuration if we're going to change
> > > anything. I think XML configurations lend themselves to manipulation in
> > > an UI much more easily and they can be verified with an XML Scheme or
> > > XML DTD.
> > >
> >
> > I thought the point of switching to the Configuration interface was to
> > allow the xml option.  There is no reason this needs to be different
> > than the other parameters.
> 
> I'm not sure I understand the argument here. Are you saying you want to
> use a properties file? And why bother with XML? I'm just making sure I
> understand before I respond.
> 
> > john mcnally
> >
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> --
> jvz.
> 
> Jason van Zyl
> jvanzyl@apache.org
> 
> http://tambora.zenplex.org
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Driver dependencies in Torque 3.0

Posted by Jason van Zyl <jv...@zenplex.com>.
On Sat, 2002-03-23 at 00:08, John McNally wrote:
> Jason van Zyl wrote:
> > 
> > On Fri, 2002-03-22 at 18:57, John McNally wrote:
> > > Please send a patch to get your driver included in DBFactory.  There is
> > > not much reason to recode to the old style.  Soon torque will use any
> > > connection pool and the adapter will be specified in the properties
> > > file.  Similar to the old way, but there will be no tie between the
> > > adapter and the driver (if a driver is even used.)
> > 
> > Can we please use an XML configuration if we're going to change
> > anything. I think XML configurations lend themselves to manipulation in
> > an UI much more easily and they can be verified with an XML Scheme or
> > XML DTD.
> > 
> 
> I thought the point of switching to the Configuration interface was to
> allow the xml option.  There is no reason this needs to be different
> than the other parameters.

I'm not sure I understand the argument here. Are you saying you want to
use a properties file? And why bother with XML? I'm just making sure I
understand before I respond.
 
> john mcnally
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://tambora.zenplex.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Driver dependencies in Torque 3.0

Posted by John McNally <jm...@collab.net>.
Jason van Zyl wrote:
> 
> On Fri, 2002-03-22 at 18:57, John McNally wrote:
> > Please send a patch to get your driver included in DBFactory.  There is
> > not much reason to recode to the old style.  Soon torque will use any
> > connection pool and the adapter will be specified in the properties
> > file.  Similar to the old way, but there will be no tie between the
> > adapter and the driver (if a driver is even used.)
> 
> Can we please use an XML configuration if we're going to change
> anything. I think XML configurations lend themselves to manipulation in
> an UI much more easily and they can be verified with an XML Scheme or
> XML DTD.
> 

I thought the point of switching to the Configuration interface was to
allow the xml option.  There is no reason this needs to be different
than the other parameters.

john mcnally

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Driver dependencies in Torque 3.0

Posted by Jason van Zyl <jv...@zenplex.com>.
On Fri, 2002-03-22 at 18:57, John McNally wrote:
> Please send a patch to get your driver included in DBFactory.  There is
> not much reason to recode to the old style.  Soon torque will use any
> connection pool and the adapter will be specified in the properties
> file.  Similar to the old way, but there will be no tie between the
> adapter and the driver (if a driver is even used.)

Can we please use an XML configuration if we're going to change
anything. I think XML configurations lend themselves to manipulation in
an UI much more easily and they can be verified with an XML Scheme or
XML DTD.
 
> john mcnally
> 
> Humberto Hernandez Torres wrote:
> > 
> > I was trying to make Scarab run with MS SQL but my driver JDBC wasn´t being
> > recognized. After looking around for a while and downloading the CVS sources
> > for torque-3.0. I found that in org.apache.torque.adapter.DBFactory there is
> > a map with the databases and the available drivers. This mapping didn´t seem
> > to be there in the  previous versions and I don´t think it should be
> > hardcoded since it makes you loose the flexibility to use your favorite JDBC
> > driver.
> > 
> > ¿What is the purpose of the new version? ¿Shouldn't we go back to the
> > previous configurable adapters?
> > 
> > This used to work in TurbineResources.properties:
> > services.DatabaseServices.database.adaptor=DBMSSQL
> > services.DatabaseServices.database.DBMSQL=com.jnetdirect.jsql.JSQLDriver
> > 
> > --
> >  Humberto
> > 
> > --
> > To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> > For additional commands, e-mail: <ma...@jakarta.apache.org>
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>
-- 
jvz.

Jason van Zyl
jvanzyl@apache.org

http://tambora.zenplex.org


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Driver dependencies in Torque 3.0

Posted by John McNally <jm...@collab.net>.
Please send a patch to get your driver included in DBFactory.  There is
not much reason to recode to the old style.  Soon torque will use any
connection pool and the adapter will be specified in the properties
file.  Similar to the old way, but there will be no tie between the
adapter and the driver (if a driver is even used.)

john mcnally

Humberto Hernandez Torres wrote:
> 
> I was trying to make Scarab run with MS SQL but my driver JDBC wasn´t being
> recognized. After looking around for a while and downloading the CVS sources
> for torque-3.0. I found that in org.apache.torque.adapter.DBFactory there is
> a map with the databases and the available drivers. This mapping didn´t seem
> to be there in the  previous versions and I don´t think it should be
> hardcoded since it makes you loose the flexibility to use your favorite JDBC
> driver.
> 
> ¿What is the purpose of the new version? ¿Shouldn't we go back to the
> previous configurable adapters?
> 
> This used to work in TurbineResources.properties:
> services.DatabaseServices.database.adaptor=DBMSSQL
> services.DatabaseServices.database.DBMSQL=com.jnetdirect.jsql.JSQLDriver
> 
> --
>  Humberto
> 
> --
> To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
> For additional commands, e-mail: <ma...@jakarta.apache.org>

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>