|
Boost : |
From: jeff_at_[hidden]
Date: 2001-06-02 15:49:21
Having used DBTools pretty extensively and having only skimmed the DTL docs here
are the differences I see:
1) DBTools provides a complete mapping solution with vendor specific drivers
for Oracle, Sybase & others (or ODBC if so desired) while DTL requires an ODBC
interface.
2) DTL is focused on integrating with the standard library, DBTools was
written pre-standard and mostly integrates with the DBTools library. Of course,
the C++ standard library does not have an analog for things like RWDate which
can be mapped to a database column.
3) DBTools provides support for asynchronous queries and multithreading, not
sure about how DTL handles these issues....
4) The DBTools equivalent of the DTL DBView functionality is provided in
DBTools by RWDBMultiRow, RWDBSchema, and RWDBOSql. The DBTools iterators are
obviously not STL based, but are similar. The concepts of binding a local
variable to placeholder in an SQL command are also provided in both libraries.
5) The total DBTools library is at least 50 classes which has been around for
years, DTL is a handful of classes and is relatively new.
So my conclusion is that DTL could use some of the capabilities of DBTools and
vice versa. Both approaches remove much low-level database programming and
increase code portability.
On question, how does DTL handle NULL values?
Jeff
> -----Original Message-----
> From: Corwin Joy [mailto:cjoy_at_[hidden]]
> Sent: Saturday, June 02, 2001 4:02 PM
> To: boost_at_[hidden]
> Subject: Re: [boost] Interest in Database Template Library?
>
>
> Well, perhaps the best way to explain in few words is to compare the
> "simple" example we give of using DTL versus the one that RW DBTools.h++
> gives:
>
> A First Example, Reading and Writing Records in a Table:
>
> As our first example, we show what the code would look like to open a table
> and read a set of rows from the database.
>
> ////////////////////////////////////////////////////////////////////////////
>
> #include "dtl.h"
> using namespace dtl;
>
> // Connect to the database
> DBConnection::GetDefaultConnection().Connect(
> "UID=example;PWD=example;DSN=example;"
> );
>
> // Create a container to hold records from a query.
> // In this case, the query will be "SELECT * FROM DB_EXAMPLE"
> DynamicDBView<> view("DB_EXAMPLE", "*");
>
> // Read all rows from the database and send to cout
> copy(view.begin(), view.end(), ostream_iterator<variant_row>(cout, "\n"));
>
> ////////////////////////////////////////////////////////////////////////////
>
>
>
> Here is the corresponding DBTools.h "simple" example that
> they use in their advertising.
> I think we compare favorably :-)!
>
>
> Example 1. DBTools.h++ marketing example
> // Select * from table1 (all rows from table1) using DBTools.h++
> #include <iostream.h>
> #include <rw/db/db.h>
> int anInt;
> RWCString aString;
> float aFloat;
> int main ()
> {
> RWDBDatabase aDB = // Open the database
> RWDBManager::database("ODBC", "Q+E_paradox", "", "",
> "c:\\paradat");
> RWDBTable aTable = aDB.table("TABLE1"); // Get the table
> RWDBSelector aSelector = aDB.selector(); // Get a selector
> aSelector << aTable; // Specifies SELECT * FROM (every row)
> RWDBReader aReader = aSelector.reader(); // Get a reader, and
> while (aReader()) { // print out each row
> aReader >> anInt >> aString >> aFloat;
> cout << anInt << '\t' << aString << '\t' << aFloat << endl;
> }
> return 0;
> }
>
>
> ----- Original Message -----
> From: "md656" <md656_at_[hidden]>
> To: <boost_at_[hidden]>
> Sent: Saturday, June 02, 2001 1:29 PM
> Subject: Re: [boost] Interest in Database Template Library?
>
>
> > So, how one can compare your DTL to RW DBTools.h++?
> >
> > Mohammed
> >
> >
> > To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
> >
> >
> > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
> >
> >
>
>
> To unsubscribe, send email to: <mailto:boost-unsubscribe_at_[hidden]>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk