-
Contents
- In the top folder are the following directories:
- docs: Documentation and examples on how to use the Database Template Library. Start with index.htm.
- lib: This is the main code for the DTL.
- example_db: Table definitions and sample data for the code in the "example" and "tests" directories.
- example: Example code for using the DTL.
- tests: Regression tests for the DTL / further examples.
- profile: Simple profiling tests versus raw ODBC calls.
- In the top folder are the following directories:
-
Getting Started:
- Take a look at the docs files starting at index.htm. Be sure to read "Introduction to the DTL" as this gives a good overview of the capabilities of the library.
- Create the sample database from the example_db directory.
- If you have a copy of Access97 there is nothing to do here. We have a sample Access database in the example_db directory.
- If you are using Oracle perform the following steps from SQL*PLUS:
- >create user example identified by example;
- >grant dba to example; -- actually we need less than this, but it's easier to grant dba
- >connect example/example;
- >@e:\dtl\example_db\tables.sql -- run the tables script to create the example tables
- >@e:\dtl\example_db\data.sql -- insert sample data into the example tables
- If you are using MySQL perform the following steps:
- create a user called "example" with password "example".
- >mysql <database_name> -u example < tables_mysql.sql -- run the tables script to create the example tables
- >mysql <database_name> -u example < data_mysql.sql -- insert sample data into the example tables
- If you are using Microsoft SQL Server:
- create a user called "example" with password "example".
- Use the data import tool to import the table definitions and data from the Access97 file example.mdb
- Create an ODBC data source called "example" from the ODBC Data Source Administrator tool in the control panel:
- The example code uses the following ODBC connect string: "UID=example;PWD=example;DSN=example;"; Therefore it connects as user "example", password "example" to the ODBC data source named "example". We assume that the user and password are already set up as explained above & show how to set up the data source name.
- Choose the tab labeled "System DSN". Choose "Add --> Microsoft Access Driver (*.mdb)". For the data source name enter "example" and choose the file called example.mdb in the example_db directory. (If you prefer to use Oracle choose the Oracle ODBC driver and enter your SQL*NET connect string etc.)
- Build and run the example code.
- Go to the directory called \example. Open the file example.dsw and build from VC++ 6.0 to create the example executable. Make sure if you are using Visual Studio 6.0 that you have at least Service Pack 5 installed!!! To compile under UNIX type "sh build.sh" which will run the makefile appropriate to your environment (LINUX, CYGWIN, HP, SOLARIS) and place the result in a ./debug directory. For Linux see ReadMeLinux.htm for details. Also, when compiling under a UNIX environment make sure the ODBC include and link directories are in your path which should be done by default. To compile under Borland (BCC) we have set up a number of makefiles in the form *.mak see ReadMeBorland.htm.
- Run the example.
example.exe 'DSN=example;UID=example;PWD=example;' (If you are running from UNIX you will need to provide the ODBC connection string as an argument to the program in quotes, in VC++ we have already done this via the debug settings).
-
Using the library in your own code:
- To use the library in your own code you will need to do two things:
- Include the \lib directory in the include (\I) path for your compiler.
- Include the library file (DTL.lib or libDTL.a) in the set of files that you link to in producing your executable.
- To use the library in your own code you will need to do two things:
Release Notes
-
Version 3.6.11; Released May 22, 2008
***Bugfixes***- Minor changes to compile under gcc 4.1.2.
- Minor changes to compile under 64 bit Linux.
-
Version 3.6.10; Released Aug 14, 2005
***Bugfixes***- Fixed bug in DynamicDBView that caused key fields to sometimes incorrectly append field names.
- Minor header change to support GCC 4.0 and latest STLPort version 5.0 from Darko Miletic. Also, updated Borland build files from Darko.
- Fixes to user defined validation support. These mostly corrected some errors that would manifest in nullable, dtl_enum and dtl_set types from Paul Harris.
- Fixes to nullable class to correct problems when working with NULL fields and select_update iterator.