SunQuest
 
       Practices
  Home arrow Practices arrow Page 5 - Database Independent Development in C
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Actuate Whitepapers 
VeriSign Whitepapers 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PRACTICES

Database Independent Development in C
By: Clay Dowling
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 3 stars3 stars3 stars3 stars3 stars / 10
    2004-09-27

    Table of Contents:
  • Database Independent Development in C
  • Making the Connection
  • Getting Results
  • An Example
  • Extending libdbi

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT

    Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here

    Database Independent Development in C - Extending libdbi


    (Page 5 of 5 )

    The mechanism for adding a new driver is very straight forward. In addition to the detailed guide, the full source code of the other drivers is present, which gives you a good chance to see how others have done it before.

    There are a couple of obvious candidates for inclusion. The FreeTDS library would be good for adding Microsoft SQL Server and Sybase support. The Firebird and Interbase client libraries are also good candidates. With these added to your tool kit there won't be much that can stand in the way.

    Unfortunately there really isn't room for a full example of a driver port in this article. They're rather long bits of code.

    Conclusions

    The libdbi library provides a feature for C programmers that has long been missing. Writing one program that can make use of multiple databases used to mean either using ODBC, with its inherent complications, or tying yourself to bulky technology like ADO or the Borland Database Engine. None of these solutions was a good answer for UNIX programmers, especially UNIX programmers deploying CGI programs on a hosted server.

    The libdbi interface is clean, and the list of supported databases, although small, covers most of the needs of open source developers. The relatively straightforward framework for adding new drivers means that it's not an unreasonable task to add support for databases that aren't already included, provided client libraries and headers are available.

    I'll definitely be using libdbi in future products, both for CGI and desktop applications. If the library shows up well in production, I hope to make it one of my most frequently used tools.


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

     

       

    PRACTICES ARTICLES

    - Finishing the System`s Outlines
    - The System in So Many Words
    - Basic Data Types and Calculations
    - What`s the Address? Pointers
    - Design with ArgoUML
    - Pragmatic Guidelines: Diagrams That Work
    - Five-Step UML: OOAD for Short Attention Span...
    - Five-Step UML: OOAD for Short Attention Span...
    - Introducing UML: Object-Oriented Analysis an...
    - Class and Object Diagrams
    - Class Relationships
    - Classes
    - Basic Ideas
    - Choosing the Right Team
    - Trees





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 1 hosted by Hostway